473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Problem LDAP and Win2003 AD

Hello!
I'm trying simple scripts to browse an Active Directory via LDAP
functions...
My domain is: schoollm.lan

The script I'm trying:

----------
$root_dn = "ad***********@mascheroni.lan";
$root_pw = "secret";

$conn = ldap_connect("192.168.10.1") or die("Could not connect to
server");

ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);

$r = ldap_bind($conn, $root_dn, $root_pw) or die("Could not bind to
server");

$result = ldap_search($conn,"dc=schoollm, dc=lan","(cn=*)") or die
("Error in search query");

$info = ldap_get_entries($conn, $result);

for ($i=0; $i<$info["count"]; $i++)
{
echo "dn is: ". $info[$i]["dn"] ."<br>";
echo "first cn is: ". $info[$i]["cn"][0] ."<br>";
echo "first email address is: ". $info[$i]["mail"][0] ."<p>"; }

echo "Number of entries found: " . ldap_count_entries($conn, $result)

ldap_close($conn);
----------

I always get this error:

Warning: ldap_search(): Search: Operations error in
C:\Programmi\Apache Group\Apache2\htdocs\ldap.php on line 12
Error in search query

Where I'm wrong?
THANKS!
Jul 17 '05 #1
0 2140

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Florian Racky | last post by:
Hi, I'm trying to get secure authentication with Novell EDirectory running. PHP Version is 4.3.1 compiled with ldap and openssl. I copied the Novell root-certificate into the OpenSSL...
0
by: Luca Bighi | last post by:
I try to use ldap-star-tls to connect to a win2003 domain controller and browse AD. $ds = ldap_connect("ldap://$ad_server/") ,"389"); // Connect to an LDAP server echo $debug?"<BR>LDAP...
9
by: Sheldon | last post by:
Hi, I have a mysql setting problem that is driving me mad. Hopefully someone can give some advice: On the local network I have windows 2000/iis5 machine running our intranet site, with php...
7
by: Amar | last post by:
I am trying to connect to my college LDAP directory using ASP.NET. This LDap does not have security as it returns only user demographic information. i do not need to bind with a username or...
0
by: CjB | last post by:
Good Morning, I am having some issues connecting to LDAP through PHP. I am using the function provided here: http://www.php.net/manual/en/function.ldap-bind.php (By 'edi01 at gmx dot at'). I...
1
by: Sebastian Sosna | last post by:
Hello NG ! Iam developing in C# so my cpp knowledge is limited. Ive downloaded a C++ sample wich is doing some AD Job. U can get it here : http://support.microsoft.com/?id=302515 Ive tried...
1
by: Andrew | last post by:
Hey all, Working on revamping our Intranet here and making use of the LDPA, Active Directory, Directory Services, etc. that .Net provides. I am still fairly new on this subject, so the problem...
14
by: Jonathan Smith | last post by:
I am trying to develop an app using ADSI. I have the following code: Dim ADSUser As IADsUser ADSUser = GetObject("LDAP://CN=jonsmith,CN=users,DC=domain,DC=com") ...
2
by: sbettadpur | last post by:
Hiiii > > I have installed mysql , Active perl 5.10 successfully but > Template-GD: ppm install Template-GD > PerlMagick: ppm install PerlMagick > SOAP-Lite: ppm install SOAP-Lite > ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.