well problems in ldap_search
my ldap:
//working code follows
$dn = "dc=something,dc=com";
$user="pippo";
$pass="xxx";
$host="localhost";
if (!($ldap = ldap_connect($host))) {
die ("Could not connect to LDAP server");
}
else
echo "connessione riuscita ";
if (!($res = @ldap_bind($ldap,$dn,$password)))
{
die("wrong username or password");
}
//no problems until here
//but now... if i search the root with
$sr=ldap_search($ldap,$dn,"(userprincipalname=$user)",array("ou","mail","codsiwe","userprincipalname"));
//i get the following error:
/*
Warning: LDAP: Unable to perform the search: No such object ...
*/
//but if i search an ou with
$sr=ldap_search($ldap,"ou=somethingelse,".$dn,"(userprincipalname=$user)",array("ou","mail","codsiwe","userprincipalname"));
//everything works
the problem is that i dont need to search a particular ou but i have to search into more organizational units under the dn (which i dont know their name!)
plz help me or ill be killed by my boss!!!!
thnx anyway...