ldap filter for distinguishedName
I am successfully querying our Active Directory for a user with the following code: $filter = (&(objectCategory=person)(samaccountname=someusername)); $fields = array("samaccountname","mail","manager","department","displayname","objectGUID"); $user = ldap_search($ldapconnection, $baseDn, $filter, $fields); The resulting array gives this value for the manager attribute: CN=McBossy\, Boss,OU=Users,OU=CentralOffice,DC=ds,DC=example,DC=com This looks like a distinguishedName to me. But when I try to query for the manager's record, $filter = (&(objectCategory=person)(dn='CN=McBossy\, Boss,OU=Users