Skip to content

Instantly share code, notes, and snippets.

@wim-beck
Created November 7, 2019 08:18
Show Gist options
  • Save wim-beck/684e596aeb72096843f63283dc53dd19 to your computer and use it in GitHub Desktop.
Save wim-beck/684e596aeb72096843f63283dc53dd19 to your computer and use it in GitHub Desktop.
Get the password expiration date for an AD user
param($AccountName)
Get-ADUser $AccountName -Properties displayname,msDS-UserPasswordExpiryTimeComputed | Select-Object -Property "Displayname",@{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment