Active Directory Custom Search LDAP query
I am trying to do an LDAP query in component services where I would find all the groups in a specific Organizational Unit
I've tried this and many other things but it never seems to work.
(objectCategory=group)(ou=david test*)
Can 开发者_开发百科anyone please help me. I've searched online for a while now and found nothing
Thank you Gibit
Your LDAP query just have to specify (objectClass=group)
Recall : A LDAP query is
- The nod from which you ask to begin the search (in your case the DN of your OU)
- The scope of your search (base, onelevel, subtree)
- The filter of your search ((objectClass=group))
- The attributes you want to retreive
This is what you'll find in an LDAP URL and in most of the APIs in any language.
ldap://Hote:port/base_dn?attributs?scope?filter
I hope it helps
JP
You did not mention what is the operation for these criteria and/or
If its or
(|(objectCategory=group)(ou=david test*))
It will try to find all the object either with objectcategory group or an organizational unit starting with 'david test' from the root.
If its and
(&(objectCategory=group)(ou=david test*))
It won't find anything because an organizational unit object category wont be a group.
Instead what you can do is, set the base dn as ou=david test,... and just search for 'objectCategory=group'.
If you dont know the organizational unit dn, do a first search with the filter (ou=david test*) and get the dn and set it as base dn for the next search and now search for 'objectCategory=group'
精彩评论