Through LDAP I am trying to get te e-mail adresses of all users in a group. Below is the code I've got and I can't get it to work. The error I get is: Bad search filter.
if ($ldapconn) {
echo "jep";
echo "<br />";
$basedn = "DC=lab,DC=kuhlmann-its,DC=local";
$classname = "TAI2";
$filter = "(&(objectClass=user)(memberOf=OU=TAI2,OU=Accounts,OU=BBS_Students,OU=BBS,OU=EDUNET))";
$attributes = array("givenName", "sn", "mail");
$search = ldap_search($ldapconn, $filter, $attributes);
$info = ldap_get_entries($ldapconn, $search);
}
This is my first time working with LDAP and Active Directory and I don't know how all the functions work. I want to know why my ldap_search() is not working.
Thanks in advance.