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
Ldap question: Getting List os AD users
Moderator: General Moderators
Re: Ldap question: Getting List os AD users
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
Of course, you should change your filter and ldap_search()'s second argument to match your setup.
For example
Code: Select all
$filter='(ObjectClass=user)';
$results = ldap_search($link,'ou=Users,o=YourOrganization',$filter);
$entries = ldap_get_entries($link,$results);Real programmers don't comment their code. If it was hard to write, it should be hard to understand.