note 38286 deleted from ref.com by nlopess

From: Date: Mon, 15 Dec 2003 15:09:05 +0000
Subject: note 38286 deleted from ref.com by nlopess
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-61984@lists.php.net to get a copy of this message
Note Submitter: kleontiv -at- combellga -dot- ru ---- I think some one wants to access to Microsoft Active Directory using ADSI with different credential by PHP. You can also do it via pure LDAP but using ADSI it is more simpler. On VB, VBS or ASP you can do like folowing (so not trivial): <% Set dso = GetObject("LDAP:") Set DsObj = dso.OpenDSObject( _ "LDAP://DC=combellga,DC=ru", _ "DOMAIN\login", _ "password", _ ADS_SECURE_AUTHENTICATION + ADS_SERVER_BIND + ADS_USE_ENCRYPTION) for each Obj in DsObj Response.Write Obj.name & " with class of: " & Obj.class & "<br>" next %> On PHP you can do like that: <?php $ADSI = new COM("LDAP:") ; $DsObj = $ADSI->OpenDsObject("LDAP://DC=combellga,DC=ru", "OFFICE\Installer", "Install@combellga.ru", 515) ; while($Obj = $DsObj->Next()) { echo $Obj->name.' with class of: '.$Obj->class.'<br>' ; } ?> The access type enumeration you can use as ADS_AUTHENTICATION_ENUM.

« previous php.notes (#61984) next »