Advertisement
Guest User

Untitled

a guest
Jul 24th, 2017
439
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. Get-MsolUser -userprincipalname user@domain.org | select DisplayName, LastPasswordChangeTimeStamp,@{Name=”PasswordAge”;Expression={(Get-Date)-$_.LastPasswordChangeTimeStamp}}
  2.  
  3. DisplayName LastPasswordChangeTimestamp PasswordAge
  4. ----------- --------------------------- -----------
  5. User, Name 09-Mar-16 5:48p 42.22:34:10.6964630
  6.  
  7. Get-MsolUser -All | select DisplayName, LastPasswordChangeTimeStamp,@{Name=”PasswordAge”;Expression={(Get-Date)-$_.LastPasswordChangeTimeStamp}} | where {$_.PasswordAge -gt “30”} | sort-object PasswordAge -descending
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement