I’m running an ldap_list with this filter:
"(&(givenname=*)(objectClass=User)(!department=Executive))"
and I get zero results and this warning in the PHP log:
ldap_get_entries(): supplied argument is not a valid ldap result resource…
If I remove the NOT operator for department and run it:
"(&(givenname=*)(objectClass=User)(department=Executive))"
I get the exact results I’m expecting and no warning. Since I get good results with the latter filter, I can only assume my ldap connection, base_DN, and attributes are correct. I’ve run both filters in Active Directory Users and Computers via the Management Console and both run perfectly so I can assume the filter is correct. Just for grins I tried ldap_search instead of ldap_list and got the same results. Any ideas?
Oh, I’m running PHP 5.2.14 on IIS 7.5.
Thanks
You need to move the operator outside the parentheses