Hi,
I have the following problem when trying to retrieve Windows 2003 AD
entry (objectclass=person).
<?php
$ad = ldap_connect($ADhost,$ADldap_port) or die( "Could not
connect!" );
$set = ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3) or
die ("Could not set ldap protocol");
$bd = ldap_bind($ad, $ADuser, $ADpass) or die ("Could not
bind");
$attrs =
array("sn","givenname","displayname","mail","samac countname","telephonenumber","description","l","ma nager","homemdb","userworkstations");
$searchFilter = "(&(objectclass=person)(".$filter."=".
$keyword."*))";
$search = ldap_search($ad, $dn, $searchFilter, $attrs) or die
("ldap search failed");
ldap_sort($ad, $search, "displayname");
$entries = ldap_get_entries($ad, $search);
?>
There is no "userworkstations" in the group of entry values. I'm sure
this attribute is set, checked it several times, also no permissions
problem. I even removed $attrs parameter from ldap_search, but no
results. I am getting the following attributes, but no
userworkstations:
array(54) {
["objectclass"]=array(5) { ["count"]=int(4) [0]=string(3)
"top" [1]=string(6) "person" [2]=string(20)
"organizationalPerson" [3]=string(4) "user" } [0]=string(11)
"objectclass"
["cn"]=array(2) { ["count"]=int(1) [0]=string(12) "Body,
Guard" } [1]=string(2) "cn"
["sn"]=array(2) { ["count"]=int(1) [0]=string(5) "Body" } [2]=>
string(2) "sn"
["description"]=array(2) { ["count"]=int(1) [0]=string(58)
"personal body guard" } [3]=string(11) "description"
["givenname"]=array(2) { ["count"]=int(1) [0]=string(5)
"Guard" } [4]=string(9) "givenname"
["distinguishedname"]=array(2) { ["count"]=int(1) [0]=>
string(115) "CN=Body\,
Guard,OU=Administration,DC=Europe,DC=acme,DC=com" } [5]=string(17)
"distinguishedname"
["instancetype"]=array(2) { ["count"]=int(1) [0]=string(1) "4" }
[6]=string(12) "instancetype"
["whencreated"]=array(2) { ["count"]=int(1) [0]=string(17)
"20060316145249.0Z" } [7]=string(11) "whencreated"
["whenchanged"]=array(2) { ["count"]=int(1) [0]=string(17)
"20060316150749.0Z" } [8]=string(11) "whenchanged"
["displayname"]=array(2) { ["count"]=int(1) [0]=string(12)
"Body, Guard" } [9]=string(11) "displayname"
["usncreated"]=array(2) { ["count"]=int(1) [0]=string(8)
"71655541" } [10]=string(10) "usncreated"
["memberof"]=array(5) { ["count"]=int(1) [0]=string(101)
"CN=Body_guards_pool,OU=Berlin,DC=Europe,DC=acme,D C=com"} [11]=>
string(8) "memberof"
["usnchanged"]=array(2) { ["count"]=int(1) [0]=string(8)
"71655714" } [12]=string(10) "usnchanged"
["department"]=array(2) { ["count"]=int(1) [0]=string(29)
"Personal Systems Production" } [13]=string(10) "department"
["company"]=array(2) { ["count"]=int(1) [0]=string(23) "ACME" }
[14]=string(7) "company"
["name"]=array(2) { ["count"]=int(1) [0]=string(12) "Body,
Guard" } [15]=string(4) "name"
["objectguid"]=array(2) { ["count"]=int(1) [0]=string(16) " SDi
°I , ¹ é" } [16]=string(10) "objectguid"
["useraccountcontrol"]=array(2) { ["count"]=int(1) [0]=string(5)
"66048" } [17]=string(18) "useraccountcontrol"
["primarygroupid"]=array(2) { ["count"]=int(1) [0]=string(3)
"513" } [18]=string(14) "primarygroupid"
["objectsid"]=array(2) { ["count"]=int(1) [0]=string(2) "]" }
[19]=string(9) "objectsid"
["samaccountname"]=array(2) { ["count"]=int(1) [0]=string(11)
"body-guard" } [20]=string(14) "samaccountname"
["samaccounttype"]=array(2) { ["count"]=int(1) [0]=string(9)
"805306368" } [21]=string(14) "samaccounttype"
["userprincipalname"]=array(2) { ["count"]=int(1) [0]=string(26)
"bo********@acme.com" } [22]=string(17) "userprincipalname"
["objectcategory"]=array(2) { ["count"]=int(1) [0]=string(57)
"CN=Person,CN=Schema,CN=Configuration,DC=acme,DC=c om" } [23]=>
string(14) "objectcategory"
["dscorepropagationdata"]=array(5) { ["count"]=int(4) [0]=>
string(17) "20070219200616.0Z" [1]=string(17)
"20061006124111.0Z" [2]=string(17) "20060809011615.0Z" [3]=>
string(17) "16010101181633.0Z" } [24]=string(21)
"dscorepropagationdata"
["manager"]=array(2) { ["count"]=int(1) [0]=string(101)
"CN=Terminator,OU=Administration,DC=Europe,DC=acme ,DC=com" } [25]=>
string(7) "manager"
["count"]=int(26)
["dn"]=string(115) "CN=Body\,
Guard,OU=Administration,DC=Europe,DC=acme,DC=com" }
Does anyone have an idea why only those attributes are retrieved?
Platform: W2k3Sp1 +Apache+PHP 5.1.1
Thank you in advance for any comment
best regards
rumich