473,396 Members | 2,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ldap and entry attributes

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

Aug 9 '07 #1
0 1926

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Angel | last post by:
Hello all - I have a LDAP service running on a NT4 box (not a mbr of my AD domain), I'd like to extract the users/attributes from that LDAP service and populate my AD domain with those users and...
4
by: James | last post by:
Why does my LDAP query from a C# console app limit its results to 1000? When I run the same query from a vb script I get over 6000 results. I have tried to set the SearchRequest.SizeLimit to a...
3
by: Dennis Dobslaf | last post by:
I try to do some authentication with LDAP. But it's a bit different to the sample in msdn. I wrote a class LdapAuthentication with a method public bool IsAuthenticated(String domain, String...
1
by: MikeD | last post by:
Hi, I've written sone C# classes to search the active directory for users - see code below. The code works fine but is very slow when I'm iterating through the directory and getting the...
2
by: Steve JORDI | last post by:
Hi, I'm checking a user identity on a secure LDAP server using the following code: $ldapconn = ldap_connect("ldaps://myserver.mycompany.ch", 636 ) or die( "Can't connect to LDAP" ) ; ...
10
by: Cruelemort | last post by:
All, I am hoping someone would be able to help me with a problem. I have an LDAP server running on a linux box, this LDAP server contains a telephone list in various groupings, the ldif file of...
3
by: Robert Iver | last post by:
Hello, I am developing an application in C# using VS .NET 2005 that will be accessing and updating Active Directory via LDAP. So, far I have written the main portions, but now I am stuck on the...
0
by: rbukkara | last post by:
Hi, I have got the following error while trying to add a user in the LDAP Directory. javax.naming.NameNotFoundException: ; remaining name 'uid=vassila,ou=People,dc=cs,dc=uno,dc=edu' I have...
2
by: Lars | last post by:
Hi I got some programming experience and I recently started looking into Python. I've read much of the tutorial from 2.6 documentation. But it was more interesting to get started on something I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.