Tuesday, 17 February 2015

Get AD User expiration date from PowerShell


 Get AD User expiration date from PowerShell


To get the user expiration date on Active Directory from Powershell with proper formatting.

Try the below cmdlet.

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






No comments:

Post a Comment