Skip to content

Instantly share code, notes, and snippets.

@nopslider
Created December 10, 2014 15:19
Show Gist options
  • Save nopslider/c8db16d30339faaa12ac to your computer and use it in GitHub Desktop.
Save nopslider/c8db16d30339faaa12ac to your computer and use it in GitHub Desktop.
Find users that haven't changed their password in the last year
Get-ADUser -Filter * -Properties * `
| where {($_.enabled -eq $true) -and ($_.lockedout -eq $false)} `
| where {$_.passwordlastset -lt (Get-Date).AddYears(-1)} `
| select SamAccountName, passwordlastset `
| sort passwordlastset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment