Author Posts

February 15, 2018 at 12:32 am

Hi All,

What short PowerShell command can I use to find out password expiration date of a specific user?

Thank you,

February 15, 2018 at 1:09 am

Have you heard about a technology enabling people to search the internet for specific things? 😉

Powershell Active Directory password expiration date

February 15, 2018 at 9:28 am

You can try the below scipt:

Import-Module ActiveDirectory
Get-ADUser -SearchBase "OU=TestOU,DC=TestDomain,DC=Local" -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} -Properties "SamAccountName","msDS-UserPasswordExpiryTimeComputed" |
Select-Object -Property "SamAccountName", @{Name="Password Expiry Date"; Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}} |

You may also take help from the following links which assists you to email users a active directory password expiration notification and schedule reports, alerts with all password expiration related tasks.

March 5, 2018 at 5:17 pm

thank you for your response, but, is there a way to revert back on this?