I'm using PHP to query users and their attributes in Active Directory. The problem I have is that the LDAP field for Department Manager is not only returning the user name, but also the FQDN (fully qualified domain name) path as shown below:
CN=User Name,OU=Users,OU=companyBranchOffice,OU=companyName,DC=subdomain,DC=domain,DC=com
The result is saved in a string, $depManager. How can I filter out only the user name (CN=)?
Thanks in advance!