I spent most of the day studying this problem. For some reason, I canβt understand for life what is happening with the code below. This is a stripped down / modified version of the example given in the PHP manual.
When I run the following code, I get an error:
Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\wamp\www\ldap.php on line 12
Relevant Code:
<?php $ds=ldap_connect("serverName.first.second.third.fourth"); ldap_set_option($ds, LDAP_OPT_REFERRALS, 0); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); $r=ldap_bind($ds); $sr=ldap_search($ds, "OU=InfoSystems,OU=Domain Users,DC=first,DC=second,DC=third,ED=fourth", "sn=MyActualSurName"); ldap_close($ds); ?>
I used a VBS script to print the current logged in user (Me) of the full DN. From this, I connected the corresponding OU and DC fields.
Any help would be greatly appreciated. If further clarification is required, feel free to ask.
user890443
source share