LDAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesLDAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 27th, 2008, 02:42 AM
thepip3r thepip3r is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 109 thepip3r User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 h 38 m 50 sec
Reputation Power: 9
LDAP Problems with LDAP_Search() and Active Directory -- HELP PLX!

Ok, it appears that other people are also having massive problems with this but I hope that someone might be able to offer a little more insight into what might be the problem. My problem is that, I can establish an LDAP connection to my domain controller and bind, but when I run a search, I get some generic "Operations Error". It's the most unhelpful generic error possible!! Here is my simplified code that I've narrowed the problem down to in order to just troubleshoot this issue:


Code:
<? 
    // Connect to the directory server. 
    $ad = ldap_connect("myserver.my.local.domain") 
          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 to the directory server. 
    $bd = ldap_bind($ad) or 
          die("Couldn't bind to AD!"); 

    echo "SUCCESS!"; 

    // Carry out directory server-specific tasks. 

    $dn = "ou=root ou,DC=my,DC=local,DC=domain"; 

    $filter = "(cn=*)"; 

    $result = ldap_search($ad, $dn, $filter); 
    var_dump($result);
    $entries = ldap_get_entries($ad, $result); 

    for ($i=0; $i<$entries["count"]; $i++) 
       { 
       echo $entries[$i]["displayname"] 
             [0]."(".$entries[$i]["l"][0].")<br />"; 
       } 
                 
    // Close the connection 
    ldap_unbind($ad); 
?> 

and the error that gets thrown is:


Code:
SUCCESS!
Warning: ldap_search() [function.ldap-search]: Search: Operations error in C:\adw\ldap\test2.php on line 21
bool(false) 
Warning: ldap_get_entries(): supplied argument is not a valid ldap result resource in C:\adw\ldap\test2.php on line 23

Reply With Quote
  #2  
Old February 2nd, 2011, 12:34 PM
jescor jescor is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Posts: 1 jescor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 33 m 9 sec
Reputation Power: 0
warnning: ldap_search

Hi, I've tried to solve this warnning but really has been impossible, If you could solve it, please help me. I get the same warnning than you when I execute function ldap_search ... thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesLDAP Programming > LDAP Problems with LDAP_Search() and Active Directory -- HELP PLX!

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap