Created
January 31, 2016 10:35
-
-
Save arieljannai/b585093bd51df3aa90d8 to your computer and use it in GitHub Desktop.
Get all the users that their password has been expired (expiry date is set to the epoch date 1/1/1601 2:00:00 AM)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties "SamAccountName", "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "SamAccountName", "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} | Where-Object {$_.ExpiryDate -like '*1601*'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment