Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP query

Status
Not open for further replies.

xseries1

Technical User
Joined
Aug 31, 2005
Messages
3
Location
FR
Can anyone tell me how to write a LDAP query to query from a specific OU in my tree
Here is the query I want to execute, but it gives me all the objects from the tree, i want to run it from a specific OU ?

(&(&(|(&(objectCategory=person)(objectSid=*)(!samAccountType:1.2.840.113556.1.4.804:=3))(&(objectCategory=person)(!objectSid=*))(&(objectCategory=group)(groupType:1.2.840.113556.1.4.804:=14)))(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group) ))))
 
> i want to run it from a specific OU
You specify the base to search from like this.
[tt] sbase="<LDAP://OU=Organic Units,DC=cern,DC=ch>"[/tt]
The complete query string consists of four parts. That is the first part where you specify from where you want to run.
 
Thank you for your answer,
But i don't know how to do in my exchange 2003 environnement.
to query user mailbox ,group and contact,the wizard give me this script

(&(&(& (mailnickname=*) (| (&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group) ))))

I dont know where to put your script to start from the specific OU (sbase="<LDAP://OU=Organic Units,DC=cern,DC=ch>")
I'm a beginner in ldap..
Thanks a lot



 
Can anyone help out here ????

I am writing a C program using LDAP API within.

I have an LDAP tree of about 5 million records. As the result, my ldap_search_s always return an error and never could complete.

filter = "(&(cn=*)(objectclass=Customers))";
lderr = ldap_search_s( ld, search_dn, LDAP_SCOPE_ONELEVEL, filter, NULL, 0, &result );

The error message is: LDAP OUT OF MEMORY.

How do you go around this ? Do I have to break it up into smaller pieces and search 4,5 different times and live with it ?

Thank you





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top