Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDAP - Cannot search lower than top level

Status
Not open for further replies.

Guern

Programmer
Joined
Jun 22, 2001
Messages
91
Location
GB
Hi,

I'm currently trying to seach windows 2003 active directory for user information. Even with the query

dc=mydomain,dc=com and cn=*

I only ever get the top level searched, i.e. only about 10 answers, all system accounts. There should be 1000's and if I use ldapsearch from the command prompt with the same query they are all returned.

My code is very simply using

$ds=ldap_connect("localhost");
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
$r=ldap_bind($ds);
$sr=ldap_search($ds,"dc=mydomain,dc=com", "cn=*");
$ldapResults = ldap_get_entries($ds, $sr);

for ($item = 0; $item < $ldapResults['count']; $item++)
{
Then loop through the results.

Any ideas how to get this to search the entire directory and not just the top level?

Thanks.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top