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
Solved

LDAP Query for Contacts and Groups in a specific OU

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

789 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