Note: I'm cross-posting the below to nyphp.org as well.
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~
I've been struggling with an issue for a few months. I am attempting to
search Active Directory 2003 via PHP, but am running into an issue
searching
from the base DN (i.e. 'cn=company,cn= com'). This seems to be somewhat
of a
known issue with AD2K3. A search at this level always returns:
Warning: ldap_search() [function.ldap-search]: Search: Partial results
and
referral received
If I change my base DN to 'ou=someOU,dc=c ompany,dc=com', searches work
properly. I was curious to see what would happen at the command line,
so I
used openldap's ldapsearch function against AD and sure enough I got a
bunch
of results that were truncated with
ldap_result: Can't contact LDAP server
Of note: I have a base php class that sets the following options
whenever a
bind is created (seems to be necessary for searching AD2K3 at all):
ldap_set_option ($this->_ldap, LDAP_OPT_REFERR ALS, 0);
ldap_set_option ($this->_ldap, LDAP_OPT_PROTOC OL_VERSION, 3);
Anyone have any feedback about how to search the base dn of AD2K3?
~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~
I've been struggling with an issue for a few months. I am attempting to
search Active Directory 2003 via PHP, but am running into an issue
searching
from the base DN (i.e. 'cn=company,cn= com'). This seems to be somewhat
of a
known issue with AD2K3. A search at this level always returns:
Warning: ldap_search() [function.ldap-search]: Search: Partial results
and
referral received
If I change my base DN to 'ou=someOU,dc=c ompany,dc=com', searches work
properly. I was curious to see what would happen at the command line,
so I
used openldap's ldapsearch function against AD and sure enough I got a
bunch
of results that were truncated with
ldap_result: Can't contact LDAP server
Of note: I have a base php class that sets the following options
whenever a
bind is created (seems to be necessary for searching AD2K3 at all):
ldap_set_option ($this->_ldap, LDAP_OPT_REFERR ALS, 0);
ldap_set_option ($this->_ldap, LDAP_OPT_PROTOC OL_VERSION, 3);
Anyone have any feedback about how to search the base dn of AD2K3?