By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,728 Members | 1,143 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,728 IT Pros & Developers. It's quick & easy.

objectGuid clipped with ldap

100+
P: 107
Hi,

I have a php script to retrieve data about a user from the active directory using ldap. Here's a cut down version:

Expand|Select|Wrap|Line Numbers
  1.     $domainName = "domain.com";  
  2.     $serverName = "server";
  3.     $baseDomainName = "DC=domain,DC=com";
  4.  
  5.     $connection = ldap_connect($serverName);
  6.  
  7.     ldap_set_option($connection, LDAP_OPT_PROTOCOL_VERSION, 3);
  8.     ldap_set_option($connection, LDAP_OPT_REFERRALS, 0);
  9.  
  10.  
  11.  
  12.     $user = "User";
  13.     $pass = "Password1";
  14.  
  15.     $_bind = @ldap_bind($connection, $user."@".$domainName, $pass);
  16.  
  17.     $filter = "samaccountname=firstname.surname";
  18.     $fields = array("objectguid", "dn");
  19.  
  20.     $ldapSearch = ldap_search($connection, $baseDomainName, $filter, $fields);
  21.     $ldapResults = ldap_get_entries($connection, $ldapSearch);
  22.  
  23.     echo "<pre>";
  24.     print_r($ldapResults);
  25.     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
Dec 8 '08 #1
Share this Question
Share on Google+
1 Reply


100+
P: 107
sorry its actually win server 2000 where it doesnt work

Cheers
Dec 8 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.