note 38286 added to ref.com

From: Date: Mon, 15 Dec 2003 14:24:50 +0000
Subject: note 38286 added to ref.com
Groups: php.notes 
Request: Send a blank email to php-notes+get-61981@lists.php.net to get a copy of this message
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. ---- Manual Page -- http://www.php.net/manual/en/ref.com.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+38286 Delete -- http://master.php.net/manage/user-notes.php?action=delete+38286&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+38286&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#61981) next »