Powershell – Active Directory CSV User list for an Audit

If you ever have someone come along and ask for a full list of AD users, and they want to know if an account is disabled, LastLogon etc etc for say a Audit of some sort.  Here then is a simple one liner using Quest Software (Link over on my links page) Powershell add-on to do just that and export it to a csv for use in Excel.


C:\>get-qaduser | select-object DisplayName, Description, Department, Manager, LogonName, AccountIsDisabled, LastLogonTimestamp, PasswordExpires, ParentContainer | export-csv C:\AD_Users.csv -NoTypeInformation

Then import the AD_Users.csv to excel and delimited by commas.

If you are interested in some other field you can look at your options by listing all the attributes for a single users like so:

C:\>get-qaduser username | fl

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: