Hi,
I have a php script to retrieve data about a user from the active directory using ldap. Here's a cut down version:
I want to use the "objectguid " for other things and on one server (just running windows xp) it runs fine and returns everything I need. But the exact same code run on a different server doesnt always return the full objectguid, it crops it to anywhere around 16-18 characters. It should be 32. most the time its fine, just on the odd user account, seems like the same accounts every time.
Could this be because the server is running a different OS (ie Windows Server 2003). Or could there be another reason (php/apache settings?) why the objectGUID is being clipped.
Thanks for any help
Andy
I have a php script to retrieve data about a user from the active directory using ldap. Here's a cut down version:
Code:
$domainName = "domain.com";
$serverName = "server";
$baseDomainName = "DC=domain,DC=com";
$connection = ldap_connect($serverName);
ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
$user = "User";
$pass = "Password1";
$_bind = @ldap_bind($connection, $user."@".$domainName, $pass);
$filter = "samaccountname=firstname.surname";
$fields = array("objectguid", "dn");
$ldapSearch = ldap_search($connection, $baseDomainName, $filter, $fields);
$ldapResults = ldap_get_entries($connection, $ldapSearch);
echo "<pre>";
print_r($ldapResults);
echo "</pre>";
I want to use the "objectguid " for other things and on one server (just running windows xp) it runs fine and returns everything I need. But the exact same code run on a different server doesnt always return the full objectguid, it crops it to anywhere around 16-18 characters. It should be 32. most the time its fine, just on the odd user account, seems like the same accounts every time.
Could this be because the server is running a different OS (ie Windows Server 2003). Or could there be another reason (php/apache settings?) why the objectGUID is being clipped.
Thanks for any help
Andy
Comment