Determine AD account password expiry date

Two quick methods to find the password expiry date of an Active Directory user account.

With cmd.exe

net user <username> /domain

With PowerShell

A bit longer but potentially more useful for integration into larger scripts.

Get-ADUser -Identity <username> –Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" | Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}

Alternatively Identity <username> can be replaced with -Filter * to show all accounts.