PowerShell Command to List Users and Password Expiration Dates

Mark Berry March 13, 2015

Here from TechNet is a quick PowerShell script to list enabled Active Directory Accounts and their password expiration dates:

Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | `
Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} 

Please use the lower comment form while we work out a formatting issue.





Leave a Reply

Your email address will not be published. Required fields are marked *

*

Notify me of followup comments via e-mail. You can also subscribe without commenting.