473,396 Members | 1,996 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,396 software developers and data experts.

unable to connect to active directory server

I'm trying to connect to an Active Directory server and am having some
difficulties. Here's the code I'm using:

<?php
if (!($ldap = ldap_connect('domain.tld'))
{
exit('unable to connect');
}

ldap_bind($ldap, 'username', 'password');
?>

With that code, I get the following error:

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server:
Invalid credentials in C:\htdocs\test.php on line 10

The thing is... I can connect just fine using Active Directory
Explorer v1.01 [1] using the same info as above. The only thing I
can figure is that Active Directory Explorer is doing something that
PHP doesn't. Maybe it connects to a different port than PHP does by
default? Maybe it appends something to the username?

[1] http://www.microsoft.com/technet/sys...dexplorer.mspx
Jul 31 '08 #1
3 6817
yawnmoth <te*******@yahoo.comwrote:
I'm trying to connect to an Active Directory server and am having some
difficulties. Here's the code I'm using:

<?php
if (!($ldap = ldap_connect('domain.tld'))
{
exit('unable to connect');
}

ldap_bind($ldap, 'username', 'password');
?>

With that code, I get the following error:

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server:
Invalid credentials in C:\htdocs\test.php on line 10

The thing is... I can connect just fine using Active Directory
Explorer v1.01 [1] using the same info as above. The only thing I
can figure is that Active Directory Explorer is doing something that
PHP doesn't. Maybe it connects to a different port than PHP does by
default? Maybe it appends something to the username?

[1] http://www.microsoft.com/technet/sys...dexplorer.mspx
Can you run Wireshark on the two sets of transactions
and post the (sanitized) traces?

Aug 2 '08 #2
On Aug 1, 7:42*pm, Charles Polisher <cpol...@nonesuch.comwrote:
yawnmoth <terra1...@yahoo.comwrote:
I'm trying to connect to an Active Directory server and am having some
difficulties. *Here's the code I'm using:
<?php
if (!($ldap = ldap_connect('domain.tld'))
{
* *exit('unable to connect');
}
ldap_bind($ldap, 'username', 'password');
?>
With that code, I get the following error:
Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server:
Invalid credentials in C:\htdocs\test.php on line 10
The thing is... *I can connect just fine using Active Directory
Explorer v1.01 [1] *using the same info as above. *The only thing I
can figure is that Active Directory Explorer is doing something that
PHP doesn't. *Maybe it connects to a different port than PHP does by
default? *Maybe it appends something to the username?
[1]http://www.microsoft.com/technet/sysinternals/networking/adexplorer.mspx

Can you run Wireshark on the two sets of transactions
and post the (sanitized) traces?
I actually figured it out - Active Directory Explorer automatically
appends the domain name to the username (eg. us**@domain.tld), whereas
PHP, I guess, doesn't, and instead, requires you manually add it.
Aug 4 '08 #3
I was having the same issues when trying to use the ldap functions in
PHP so I created a class that utilizes ADSI instead of LDAP. You can
grab it here http://www.phpclasses.org/browse/package/4549.html. I
found that utilizing COM & ADSI made the whole thing alot easier.

On Jul 31, 4:42*pm, yawnmoth <terra1...@yahoo.comwrote:
I'm trying to connect to an Active Directory server and am having some
difficulties. *Here's the code I'm using:

<?php
if (!($ldap = ldap_connect('domain.tld'))
{
* * * * exit('unable to connect');

}

ldap_bind($ldap, 'username', 'password');
?>

With that code, I get the following error:

Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server:
Invalid credentials in C:\htdocs\test.php on line 10

The thing is... *I can connect just fine using Active Directory
Explorer v1.01 [1] *using the same info as above. *The only thing I
can figure is that Active Directory Explorer is doing something that
PHP doesn't. *Maybe it connects to a different port than PHP does by
default? *Maybe it appends something to the username?

[1]http://www.microsoft.com/technet/sysinternals/networking/adexplorer.mspx
Aug 5 '08 #4

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

Similar topics

1
by: Amadelle | last post by:
Hi all, I am so desparately in need of some guidance! After two days of struggling I still can't connect to the Active Directory server. I have used so many different ways and so many different...
5
by: Bruce Schechter | last post by:
I just started to develop an ASP.NET application in vs.net 2003 . But each time I try to execute the application (which is basically empty so far), I get a dialog box titled "Microsoft Development...
3
by: hkappleorange | last post by:
I connect to mdb file using the following codes. How should I modify it if I want to connect to Excel instead ? <%@ Import Namespace="System.Data.OleDb" %> <% Dim conAuthors As...
0
by: RTT | last post by:
here is my current situation. I develop a program on my computer's localhost. From there i contact Active directory succesfull using a connectionstring like:...
2
by: Mondal | last post by:
Hi, I am using MySQL 5.0 beta and Active Python 2.4. I have the correct version of MySQLdb installed. The problem is that I can't connect to MySQL through the Active Python interactive window. ...
4
by: traceable1 | last post by:
I have a couple new servers - Windows 2003 R2 - with SQL Server 2000 SP4 installed. They are all Active/Active clustered instances (my first ones). I am trying to create database links to other...
11
by: Mikael Arhelger | last post by:
Hello, This has been posted a few times but still I could not find a way to connect to our database. We run DB2 Express on WIN2K server with XP clients. I can ping inside network and to the...
3
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
Last week I asked a question about connection to database from client machine (developer machine). I have changed the database security setup for "SQL Server and Windows" under (local)Windows NT...
0
by: nimjerry | last post by:
i am using db2 udb V 9 on aix 5.3 and in db2diag.log alwas has this error occurr below is sample message 2008-03-03-09.45.34.366406+420 I306667A443 LEVEL: Warning PID : 835622 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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.