Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

problem with LDAP functions in PHP

archamonarchamon Member Posts: 1
Hi,

I've been trying some LDAP functions in PHP and am stuck at trying to bind to the LDAP server.

Qs.1:

basically i've successfully queried using some LDAP functions when it comes to querying a single server but when I try to do it via an array, i get errors that say "unable to bind to server".

eg. of my script:

this works:

$ds=ldap_connect("afd-s-31");
if ($ds) {
$r=ldap_bind($ds, "john", "h92de" );
}

this doesn't work:

$servers = array("afd-s-31","afd-s-33");

for ($i=0;$i";
}
}

The error occurs on the line with ldap_bind().

Qs.2

another thing when i do a search filter, i get this error message:
LDAP: Unable to perform the search: Bad search filter

$dn = "OU=User Accounts,OU=User Directory,DC=xyz,DC=com";
$filter="(&(objectClass=user)(msExchUserAccountControl=2)(!msExchMasterAccountSid=*))";

$sr=ldap_search($ds, $dn, $filter);

can anyone spot anything wrong with my LDAP search filters?

thanks for any help.

Comments

  • Chris BrownChris Brown USAMember Posts: 4,496 ✭✭

    ________ ( http://forcoder.org ) free video tutorials and ebooks about || C#, MATLAB, Visual Basic .NET, Go, Assembly, Delphi, Ruby, Scratch, C, Swift, C++, PHP, Visual Basic, Objective-C, Python, R, Java, JavaScript, PL/SQL, Perl Alice, Scala, Crystal, FoxPro, Clojure, Rust, Apex, COBOL, Hack, Fortran, Lua, Ada, Awk, Transact-SQL, Erlang, Prolog, ML, F#, Lisp, VBScript, Scheme, LabVIEW, Dart, Logo, Kotlin, D, ABAP, SAS, Bash, Julia || ______________

Sign In or Register to comment.