Jump to content


Photo

LDAP. Help please!


  • Please log in to reply
No replies to this topic

#1 dan400007

dan400007
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 10 October 2006 - 08:39 PM

I'm having a problem when searching my MS Active Directory using LDAP.

If I specify an OU (such as OU=Techs, DC=Domain, DC=Local) then my search works without a problem.

If I change the search location to the entire Active Directory (DC=Domain, DC=Local) then my search returns "Warning: ldap_search() [function.ldap-search]: Search: No such object in C:\snm_fn\group_fn.php on line 11".

Does LDAP allow you to search the entire directory, or am I doing something wrong.

Thanks for any help, Dan.

Code:
$dc = ldap_connect($snm["ldapserver"], $ldap_port);

if ($dc) {
//Set user details to bind to the active directory.
ldap_bind($dc, $snm["ldapuser"], $snm["ldappassword"]);

//Set the search parameters
$s_filter = "(&(objectCategory=group))";
$s_fields = array("cn");

$searchresults = ldap_search($dc, "DC=domain, DC=local", $s_filter, $s_fields); //Perform the search
$data = ldap_get_entries($dc, $searchresults); //Get LDAP search results

print_r($data);

ldap_close($dc);
}




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users