Link to home
Start Free TrialLog in
Avatar of annayeg
annayeg

asked on

ADFIND unique titles for all the OU's

Hi all,
I am trying to construct a query to give me all the unique titles for the users in all the OU's.  I am new at adfind.  Can I get some help?  thanks
ASKER CERTIFIED SOLUTION
Avatar of ChandarS
ChandarS
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of annayeg
annayeg

ASKER

adfind -default -f "(&(objectclass=user)(objectcategory=person))" title >> c:\data\ad utility\output\users.csv

To find only the unique titles how can I modify the above query?

Thanks
What do you mean by unique , Can you give me example ...

So I can help you out
SOLUTION
Avatar of Mike Kline
Mike Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of annayeg

ASKER

by unique I mean the following if I have 200 systems engineers and 100 associates, I just want to be able to capture 1 system engineer and 1 associate.  Basically, I want to know how many titles we have in the company.
In that case I'd export to excel,  adfind is not going to give you a count of all the titles, it will just return them.
Now you can do something like
adfind -default -f  "&(objectcategory=person)(objectclass=user)(titele=associate)"  -c  
That will give you a count of all users whose title is associate
Thanks
Mike
Just Try this out with ADFind Tool

http://www.joeware.net/freetools/tools/adfind/index.htm

What option you are getting

According you can change to the script file.
You can also create a saved query in AD Users & computers with the same LDAP queries as provided above. (Custom query type)
DEFINE > Find drop down > Custom Query...
Enter like this:
(objectcategory=person)(objectclass=user)(title=*manager*)
It will auto add the &'s. Notice you can wildcard also... in case you have Engineer-1, Engineer-2, etc..

That would tell you in the GUI how many, and let you view any if you wanted.
Avatar of annayeg

ASKER

when I run this, it checks other OU's other than "offices".  Is my syntax correct?  Basically I want to query only the Offices OU and get the name and the title.

adfind -default -f "(&(objectclass=user)(objectcategory=person)(ou=offices, ou=exchange,dc=dc,dc=howrey,dc=net))" distinguishedName title >> c:\data\ad utility\output\users.csv