I am having trouble with an LDAP Search Filter. What I am needing to retrieve is all the users of a specific LDAP group that is OU=Staff,OU=Users,OU=Accounts,DC=test,DC=local
My search is:
(&(objectCategory=user)(OU=Staff,OU=Users,OU=Accounts,DC=test,DC=local))
Currently it is returning no results. What am I missing?
解决方案
You must do two things
Set the base of the search OU=Staff,OU=Users,OU=Accounts,DC=test,DC=local
Search for the objects with the objectClass.
Using PHP, the search would look like this (based on this PHP sample):
//You must bind, first
// using ldap bind
$ldaprdn = 'yourdomain\nic_hubbard'; // ldap rdn or dn
$ldappass = 'password'; // associated password
// connect to ldap server