I am trying to find out the best way to get a users DN, when provided with their samaccountname using php and Active Directory.
I have tried
$filter="samaccountname=" . $_POST['username'];
$sr = ldap_search($ldapconn, 'DC=star, DC=com', $filter);
When you dump $sr you get FALSE.
Any ideas?
Start Free Trial