I've an Application whith searches our ldap and saves a few attributes in a cache. It's no problem to get attributes like mail displayname sn etc. but I dont get the objectguid. Maybe its just a display error course the object id is in oktett or binary format. But i dont know exaktly if Im only not able to show the objectguid or if ldap doesnt give me the objectguid.
my code is
$filter="(&(!(pager=))(!(pager=NO_MA)))";
$justthese = array("ou", "sn", "givenname", "mail", "pager","objectGUID");
$sr=ldap_search($ad, $basedn, $filter, $justthese);
$info = ldap_get_entries($ad, $sr);
i've tried different filters and without justthese i get always the same value in $myarray[$number][objectguid][0]. It is always NULL. A few trys after i got an output but with ldap_first_entry. but i want to get the value like all other values! ive allready tryed to convert the guid with bin2hex() and unpack("H*hex,$guid") <- tryed different methodes, but i got the same value (NULL). btw i build my array like this:
for ($i=0; $i<count($info); $i++)
{
$myarray['ldap'][$i]["name"] = utf8_decode($info[$i]["givenname"][0]);
$myarray['ldap'][$i]["sname"] = utf8_decode($info[$i]["sn"][0]);
$myarray['ldap'][$i]["mail"] = $info[$i]["mail"][0];
$myarray['ldap'][$i]["pnr"] = $info[$i]["pager"][0];
$myarray['ldap'][$i]["guid"] = $info[$i]["objectGUID"][0];
}
did anyone have a idea to fix my problem? or know a better way to read the complete ad ( with filters and OBJECTGUID ) into an array?
thank you verry mutch if you answer...