I'm having troubles with ldap_search in PHP. The query below gives LDAP ERROR "-7" - Bad search filter.
Code snippet:
...
$base_dn = "ou=Example GSM,dc=example,dc=com";
$search_filter = "(userPrincipalName=example\name.surname)";
$bind_attr = "userPrincipalName";
$result = @ldap_search($ldapconn, $base_dn, $search_filter, array("dn", $bind_attr));
Do you an have idea what I'm doing wrong?
I'm using Microsoft AD and PHP 7.2.18 .