I have looked all over but can't seem to find a specific way of exporting a list of users (by the OU they are in) that contains. their account status, last login date and password change date.

I have an old dsquery command but that does not give me enough detail:

dsquery group -samid “Users” |dsget group -members -expand | dsget user -samid > userlistforauditors.txt

I also looked at the ADSI Edit tool but that does not provide an "export" of the info. Can someone help?

thanks Kay


You can start here. The script that you download might need minor tweaks. https://gallery.technet.microsoft.com/scriptcenter/Get-All-AD-Users-Logon-9e721a89

Password expiry.

Get-ADUser -Filter {Name -eq "<namehere>"} -SearchBase "DC=nzadmin,DC=local" -Properties "DisplayName", "msDS-UserPasswordExpiryTimeComputed" |Select-Object -Property "Displayname", @{Name="ExpiryDate";Expression={[datetime]::FromFileTime($_."msDS-UserPasswordExpiryTimeComputed")}}
  • Thank you for this. I will go through and tweak as needed. As you might suspect this is information for the SOC auditors. They don't just want an "export list" from the AD Users & Computers containers. Thanks again. – Girlgeek Dec 20 '18 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.