Adfind Retrieve User Information


Hi All,

Below script will retrieve user’s information from specific OU and export the data to .csv file. In order to run this script , you have to modify the DN matching to your domain
Eg: “ou=test,ou=users,ou=fin,dc=texx,dc=local


Working Script

C:\>adfind.exe -f “(&(&(|(&(ob
jectCategory=person)(objectclass=user)(objectSid=*)(!samAccountType:1.2.840.1135
56.1.4.804:=3))(&(objectCategory=person)(!objectSid=*))(&(objectCategory=group)(
groupType:1.2.840.113556.1.4.804:=14)))(objectCategory=user)(|(sn=*)(givenName=*
)(middleName=*)(personalTitle=*)(title=*)(employeeID=*)(company=*)(department=*)
(mail=*)(homePostalAddress=*)(st=*)(streetAddress=*)(postalcode=*)(telephonenumb
er=*)(mobile=*)(manager=*)(description=*))))” -b “ou=test,ou=users,ou=fin,d
c=texx,dc=local” -csv -nodn sn givenname middlename personaltitle title emp
loyeeID company department mail homepostaladdress st streetaddress postalcode te
lephonenumber mobile manager description>>c:\ldif\final.csv

You can modify the .csv file by importing into Microsoft excel.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s