Solved

LDAP Query for Contacts and Groups in a specific OU

Posted on 2009-05-05
3
2,211 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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ADFS trust for Skype 4 26
Display SQL maintenance plan SQL Code 3 47
Oracle SQL-Queries on a RAC Database 3 46
MS Access Duplicate Data Assistance 9 23
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
This article shows the method of using the Resultant Set of Policy Tool to locate Group Policy that applies a particular setting.
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 …

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