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")}} 

Leave a Reply





*