Page 1 of 1

Ldap question: Getting List os AD users

Posted: Fri Jan 22, 2010 1:00 pm
by fcaserio
I have large experience with PHP but zero contact to LDAP so far.

I'm dealing with a new application that has to list all users on an Active Directory (AD 2000).

I can connect and bind to the AD server, but I don't understand how to search the AD users.

Any help is appreciated

tks

Re: Ldap question: Getting List os AD users

Posted: Fri Jan 22, 2010 2:25 pm
by pickle
I have no experience with Active Directory, but I have worked with LDAP in Novell Directory Services for a few years. I've never needed to get a list of all users, so my solution might be a bit off. What you can do though, is search for all entities of a particular type.

For example

Code: Select all

$filter='(ObjectClass=user)';
$results = ldap_search($link,'ou=Users,o=YourOrganization',$filter);
$entries = ldap_get_entries($link,$results);
Of course, you should change your filter and ldap_search()'s second argument to match your setup.