H46615 Posted April 4, 2008 Share Posted April 4, 2008 Hi, I have two servers a Windows 2000 Server which servers my network and I have a Redhat Linux box which runs my intranet site. Currently users log on to the intranet with a separate login. I wish to connect to Active Directory on the Windows 200 Server from the Linux server. Is it possible to connect to AD using PHP LDAP from a separate server. I have PHP LDAP installed successfully on my server and have had a few attempts, which were unsucessful. I have the following code so far: $server="10.160.104.10"; //change to ip address of ldap server //change to reflect the ou and domain that your users are in. $basedn="ou=Establishments, ou=BHS, ou=System Administrators, dc=domain dc=internal"; $username="admin"; $password="password"; $dn = "dn=$username, "; if (!($connect = ldap_connect($server))) { die ("Could not connect to LDAP server"); } // code works until here if (!($bind = ldap_bind($connect, "$dn" . "$basedn", $password))) { die ("Could not bind to $dn$basedn"); } Can anyone help me with this problem or tell me where I am going wrong. Thank you in advance. Link to comment https://forums.phpfreaks.com/topic/99504-php-ldap/ Share on other sites More sharing options...
Barand Posted April 4, 2008 Share Posted April 4, 2008 I find that using this class takes a lot of pain out of using LDAP http://adldap.sourceforge.net/ Link to comment https://forums.phpfreaks.com/topic/99504-php-ldap/#findComment-509082 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.