PHP and Active directory- Help ASAP

admin

Administrator
Staff member
Hi All,

I am trying to connect to ADSI tree using PHP Ldap functions to search for users.

I am able to successfully connect and bind using anonymous bind.
But, for searching I have two problems.

1. The domain controller I have is : DC=test.soft.com (AdsPath is : <!-- m --><a class="postlink" href="LDAP://serverip:389/DC=test,DC=soft,DC=com">LDAP://serverip:389/DC=test,DC=soft,DC=com</a><!-- m -->)

when I search using the ldap_search function with the following parameters, it gives an error saying unable to connect to LDAP server:

$BaseDN = "DC=test,DC=soft,DC=com";
$sr=ldap_search($ds,$BaseDN,"CN=*");

2. When I change the search function to:

$BaseDN = "CN=Users,DC=test,DC=soft,DC=com";
$sr=ldap_search($ds,$BaseDN, "CN=*");

Search is successful but there are no results returned, even though there are users.

Am I missing something???

I want to search users, add users and delete users in the ADSI tree. Any information/sample code regarding these will be very very helpful.

Thanks in advance.
Suman
 
Back
Top