This one liner was used when the password age group policy was reduced. It caused a massive amount of users not being able to login due to the password expiry policy now in place. We needed to find the password age so we used the PasswordLastSet attribute on each AD User to export to s CSV and manipulate to find effected users.
Get-ADUser -filter {Enabled -eq $True -and PasswordNeverExpires -eq $False} –Properties * | Select DisplayName, PasswordLastSet | Export-csv C:\Password.csv
Leave a Reply