Solved

LDAP Query for Contacts and Groups in a specific OU

Posted on 2009-05-05
3
2,187 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
[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 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 71

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

This article demonstrates probably the easiest way to configure domain-wide tier isolation within Active Directory. If you do not know tier isolation read https://technet.microsoft.com/en-us/windows-server-docs/security/securing-privileged-access/s…
Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
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…
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…

756 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