PatPHP Posted March 16, 2008 Share Posted March 16, 2008 Hi I already tried out many different ways but I haven't found a solution yet. I want that my ldap query just filters or search in a group in my example called 'InternetAccess'. But it still give me the student even he is not in that group. It works fine on OUs but it fails on groups.... Somebody has an idea what could be the problem? //Connect $ad = ldap_connect("10.0.10.10"); //Set some variables ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ad, LDAP_OPT_REFERRALS, 0); //Bind to the ldap directory $bd = ldap_bind($ad,"test@test.edu.au","password") or die("Couldn't bind to AD!"); //Search the directory $result = ldap_search($ad, "OU=Students,OU=test,DC=test,DC=edu,DC=au", "CN=InternetAccess"); //Create result set $entries = ldap_get_entries($ad, $result); //Sort and print echo "User count: " . $entries["count"] . "<br /><br /><b>Users:</b><br />"; for ($i=0; $i < $entries["count"]; $i++) { echo $entries[$i]["displayname"][0]."<br />"; } //never forget to unbind! ldap_unbind($ad); thx pat Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.