Monthly Archive

Categories

Domain Admins password last set

A recent question on the forums asked about getting the date a password was last set and the password never expires status for the domain admins group

This is one way of doing it

 

Get-ADGroupMember -Identity 'Domain Admins' |
foreach {
Get-ADUser -Identity $psitem.samAccountName -Properties PasswordLastSet, PasswordNeverExpires |
select Name, PasswordLastSet, PasswordNeverExpires
}

 

Get the group and for each member get the aduser information and select the properties to display.

 

Get-ADGroupMember and Get-AdUser work together on the pipeline so you can also do this:

 

Get-ADGroupMember -Identity 'Domain Admins' |
Get-ADUser -Properties PasswordLastSet, PasswordNeverExpires |
select Name, PasswordLastSet, PasswordNeverExpires

Comments are closed.