Active Directory Audit users and generate report

Run the following commands in Server 2008  Command prompt

Generate list (csv file output) for active users in AD

csvde -d “ou=Users,DC=ABC,DC=net” -r “(&(objectCategory=person)(objectClass=user)(|(useraccountcontrol=512)(useraccountcontrol=66048)))” -L “sAMAccountName,givenName,sn,description,whenCreated” -f report_sno1.csv

Generate list from Domain Controller containing new user accounts added during the audit period (details : user name in the system, employee name and granted date and time)

csvde -d “ou=Users,DC=ABC,DC=net” -r “(&(objectCategory=person)(objectClass=user)(|(useraccountcontrol=512)(useraccountcontrol=66048))(&(whenCreated>=20130701000000.0Z)(whenCreated<=20131031000000.0Z)))” -L “sAMAccountName,givenName,sn,description,whenCreated” -f report_sno2.csv

Generate list from Domain Controller containing user accounts revoked during the audit period

csvde -d “ou=Users,DC=ABC,DC=net” -r “(&(objectCategory=person)(objectClass=user)(|(useraccountcontrol=514)(useraccountcontrol=66050))(&(whenChanged>=20130701000000.0Z)(whenChanged<=20131031000000.0Z)(whenCreated<=20131031000000.0Z)))” -L “sAMAccountName,givenName,sn,description,whenChanged” -f report_sno3.csv

Advertisements

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