Re: LDAP, PHP and MS Active Directory

From: Date: Thu, 18 Aug 2005 16:05:59 +0000
Subject: Re: LDAP, PHP and MS Active Directory
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-220875@lists.php.net to get a copy of this message
> Hello > > I am using PHP v5 to write an intranet. The site is hosted on a windows 2000 > server running Apache. I want to incorporate some form of Windows > authentication to allow or deny access to given resources based on usernames > and group membership. > > I am trying to accomplish this using LDAP. I am able to connect and bind to > our Active Directory server (also Windows 2000) from PHP, but when I want to > perform a search, I need to know what the base record is. This is in the > format o=my company, c=the country it is in. > > This is where the problem lies. How do I find out this information? Is there > some facility in Active Directory that allows me to see what the actual > name-values are for all the records (like sn=rees)? > I found a useful utility to solve this problem called CSVDE built into Windows 2000 and 2003. More information is available here http://www.computerperformance.co.uk/Logon/LDAP_attributes_active_directory. htm I also found this page useful http://www.developer.com/lang/php/article.php/3100951 > The line of code causing the problem is this: $ds is a bound connection to > the LDAP server > $sr=ldap_search($ds, "o=company name, c=uk", "sn=g*"); > > It returns "Operations error" > > Thanks in advance > > Mark > > -- > www.itsagoodprice.com - top-brand electronics for less.

« previous php.general (#220875) next »