Wednesday, June 1, 2022

PowerShell command to list Active Directory users that are active and are sorted by when the password was last set

Get-ADUser -LDAPFilter '(!userAccountControl:1.2.840.113556.1.4.803:=2)' -Properties PasswordLastSet | Select-Object Name, Enabled, PasswordLastSet | Sort PasswordLastSet –Desc

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.