Solved

ADFIND unique titles for all the OU's

Posted on 2010-09-17
9
1,275 Views
Last Modified: 2013-12-24
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
0
Comment
Question by:annayeg
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 4

Accepted Solution

by:
ChandarS earned 125 total points
ID: 33702971
0
 
LVL 1

Author Comment

by:annayeg
ID: 33703170
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
0
 
LVL 4

Expert Comment

by:ChandarS
ID: 33703196
What do you mean by unique , Can you give me example ...

So I can help you out
0
Office 365 Advanced Training for Admins

Special Offer:  Buy 1 course, get 2nd free!  Buy the 'Managing Office 365 Identities & Requirements' course w/ Accelerated TestPrep, and automatically receive the 'Enabling Office 365 Services' course FREE!

 
LVL 57

Assisted Solution

by:Mike Kline
Mike Kline earned 125 total points
ID: 33703251
So you can use Chandar's example and output any details you want, in his example he just outputted the title (DN will also be outputted in that example)
You can just add addributes if you want more.  A good page that shows list of attributes
http://www.selfadsi.org/user-attributes-w2k3.htm
Now if you want to output things that have dates and times you can decode them by adding the -tdca switch for example
If you want a csv output add -csv
Thanks
Mike
0
 
LVL 1

Author Comment

by:annayeg
ID: 33703326
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.
0
 
LVL 57

Expert Comment

by:Mike Kline
ID: 33703358
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
0
 
LVL 4

Expert Comment

by:ChandarS
ID: 33703526
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.
0
 
LVL 12

Expert Comment

by:FDiskWizard
ID: 33703846
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.
0
 
LVL 1

Author Comment

by:annayeg
ID: 33704702
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
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question