Active Directory – Find Last Password Set Date and if Password expires

Open up Powershell

import-module activedirectory (This loads active directory into powershell so you can run the commands below)

Get-ADUser -identity username -properties *
(This command gives you all the properties on 1 account)

PasswordLastSet and PasswordNeverExpires are the properties that give you the necessary output.

Get-ADUser -identity username -properties passwordlastset, passwordneverexpires
(This command gives you the two properties on one user

Get-ADUser -filter * -properties passwordlastset, passwordneverexpires | sort-object name | select-object Name, passwordlastset, passwordneverexpires | Export-csv -path c:\userpasswordinfo.csv
(This command gives you the two properties on all the users and exports it to an excel CSV document)

 

Mark as helpful. 0

Posted in: Server

Posted in