LDAP: read rootDSE
| From: | Tobias dot Loecke at Bertelsmann dot de | Date: | Fri, 16 May 2003 08:32:35 +0000 |
| Subject: | LDAP: read rootDSE | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-27799@lists.php.net to get a copy of this message | ||
Hello all,
I have trouble reading the LDAP rootDSE information (ActiveDirectory,
LDAPv3) using the PHPs LDAP function (it is working with ldapsearch
(openldap)!). We are using current PHP build.
Here is the code, it is not working in all possible combinations.... When I
apply a valid basedn I do get results, but not the rootDSE.
$ds=ldap_connect($LDAPServer);
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
$r=ldap_bind($ds, $LDAPUser, $LDAPPW);
#$justthese = array ("+");
#$justthese = array ("defaultnamingcontext");
$sr=ldap_read($ds,"","(objectclass=*)");
#$sr=ldap_read($ds,"","(objectclass=*)",$justthese);
$result = ldap_get_entries( $ds,$sr );
print_r ($result);
Anybody ever managed to get rootDSE information? How?
Thanks,
Tobias