PowerShell, Windows

Quick Windows Active Directory User Audit via PowerShell

Should you need to verify some details of a user, you can execute the following commands:

$aduser = username
Get-ADUser $aduser -Properties * | select Created, Name, GivenName, Surname, SamAccountName,UserPrincipalName, DistinguishedName, SID, Enabled, PasswordLastSet, LastLogonDate, MemberOf | fl 

And if you want to find out from the whole domain last logon dates, expired passwords, etc:

 Get-ADUser -Filter * -Properties * | Sort-Object -Property lastlogondate | ft -Property name, lastlogondate,whencreated,PasswordNeverExpires,PasswordExpired,PasswordLastSet 


Leave a Comment

Your email address will not be published. Required fields are marked *