Greetings, folks...
Attempting to use PHP's LDAP functions to hook into AD:
<?php
$ad = ldap_connect("ldap://myserver.com") or die("Couldn't connect to AD!");
ldap_set_option($ad, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ad, LDAP_OPT_REFERRALS, 0);
$bind = ldap_bind($ad) or die ("Can't Bind.");
$dn = "cn=staff,dc=staff,dc=ad,dc=myserver,dc=com";
$result = ldap_search($ad, $dn, "cn=jsmith");
ldap_unbind($ad);
?>
Results in this error:
Warning: ldap_search(): Search: Operations error in /var/www/html/ldap.php on line 13
Line 13 is:
$result = ldap_search($ad, $dn, "cn=jsmith");
I'm using RedHat Enterprise with PHP 4.3.2. Any thoughts?