Hi all,
this is _really_ bugging me, and the Google God has failed me:
Doing an ldap_search of a Wink2k Active Directory trying to get the
objectGUID. This is a unique id within AD and is meant to be a 128bit
octal string. (16 bytes).
Works 99% of the time, but the occasional objectGUID comes up short.
e.g.
$ld_filter = '(sAMAccountName=*)';
$ld_data = array('objectGUID', 'sAMAccountName');
$ld_sr = ldap_search($Connect, $ldap_base_dn, $ld_filter);
$ld_info = ldap_get_entries($Connect, $ld_sr);
for($i=0; $i < $ld_info['count']; $i++) {
$o = $ld_info[$i]['objectguid'][0];
$len = strlen($o);
print("len: $len <br>");
}
MOST of the entries are the correct 16 bytes, a FEW are not. It's like
the occasional objectGUID is barfing php somehow and not getting placed
into the holder variable, or something. Only getting the first x bytes.
The correct entries I can convert to an escaped hex string and then
search AD correctly. The incorrect ones, can't be used.
Doing an ldap_search from the command line generates a base64 encoded
string, which I can decode, convert to hex and search properly, so it's
not the AD data.
PHP Version 4.3.2
Apache/1.3.28
Linux tnz014 2.4.18-14 #1 Wed Sep 4 11:57:57 EDT 2002 i586
ldap.c,v 1.130.2.4 2003/04/30 21:54:02 iliaa Exp $
Any ideas????
Cheers,
Alan Way