Solved

LDAP Query for Contacts and Groups in a specific OU

Posted on 2009-05-05
3
2,143 Views
Last Modified: 2013-12-24
I am trying to retrieve a list of contacts or groups that are stored in a specific OU.
So far this is what I have and it works for all of AD when I select search subfolders in AD.
but I need to create a Query that specifically searches an OU without selecting the OU through the GUI in AD.  These contacts and groups do not have any memberships to any security groups.
(&(&(& (mailnickname=*) (| (&(ojectCategory=person)(objectClass=contact))(objectCategory=group) ))))

Open in new window

0
Comment
Question by:eddanielstech
3 Comments
 
LVL 57

Expert Comment

by:Mike Kline
ID: 24310692
Does this have to be a straight LDAP query (or can you use a free third patry tool)
I don't know of a way to filter for an OU in an LDAP query.
The free tool I'm thinking of is adfind by MVP Joe Richards
Thanks
Mike
0
 

Author Comment

by:eddanielstech
ID: 24310956
Unfortunately it does have to be a straight LDAP query.
0
 
LVL 70

Accepted Solution

by:
Chris Dent earned 500 total points
ID: 24316204

You cannot select an OU within a LDAP filter.

You would have to set the OU as the base for the search or add something to the object in AD that identifies it as being within the OU. An example of that would be writing the objects parent path to extensionAttribute1, then using that within the LDAP filter.

Chris
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Read about achieving the basic levels of HRIS security in the workplace.
ADCs have gained traction within the last decade, largely due to increased demand for legacy load balancing appliances to handle more advanced application delivery requirements and improve application performance.
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

708 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now