Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ldap_connection = ldap_connect('SERWER');
- ldap_set_option($ldap_connection, LDAP_OPT_PROTOCOL_VERSION, 3);
- ldap_set_option($ldap_connection, LDAP_OPT_REFERRALS, 0);
- ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7);
- $test=ldap_bind($ldap_connection);
- if ( $test ) { echo "OK"; }
- $dn = "ou=xxx,DC=xxx,DC=xxx";
- $filter="(&(objectCategory=person)(samaccountname=*))";
- $sr=ldap_search($ldap_connection, $dn, $filter);
- $info = ldap_get_entries($ldap_connection, $sr);
- echo $info["count"]."\n";
Add Comment
Please, Sign In to add comment