Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

LDAP Query for Contacts and Groups in a specific OU

Posted on 2009-05-05
3
Medium Priority
?
2,314 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 2000 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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

This process allows computer passwords to be managed and secured without using LAPS. This is an improvement on an existing process, enhanced to store password encrypted, instead of clear-text files within SQL
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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 to another domain controller. Log onto the new domain controller with a user account t…

719 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