Skip to content

Instantly share code, notes, and snippets.

@adamgell
Last active July 12, 2023 17:12
Show Gist options
  • Save adamgell/09d394d90c140207931bd3de19122eff to your computer and use it in GitHub Desktop.
Save adamgell/09d394d90c140207931bd3de19122eff to your computer and use it in GitHub Desktop.
Dump User last password set
Get-ADUser -Filter * -Properties Name,PwdLastSet,PasswordLastSet | sort Name | Select Name,@{Name='PwdLastSet';Expression={[DateTime]::FromFileTime($_.PwdLastSet)}},PasswordLastSet | Export-Csv C:\Temp\Output.csv -NoTypeInformation
@adamgell
Copy link
Author

adamgell commented Jul 12, 2023

Filtered on Active users only

Get-ADUser -Filter 'enabled -eq "true"' -Properties Name,PwdLastSet,PasswordLastSet |  sort Name | Select Name,@{Name='PwdLastSet';Expression={[DateTime]::FromFileTime($_.PwdLastSet)}},PasswordLastSet | Export-Csv C:\Temp\Output.csv -NoTypeInformation -Force```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment