' From the book "Active Directory, Third Edition"
' ISBN: 0-596-10173-2
Const ADS_SECURE_AUTHENTICATION = 1
Const ADS_USE_ENCRYPTION = 2
Dim strPath 'path to authenticate to in the directory service
Dim strUsername 'DN of the username
Dim strPassword 'plain-text password
Dim objNamespaceLDAP 'ADSI namespace object
Dim objMyObject 'root object of the directory
strPath = "LDAP://dc=amer,dc=mycorp,dc=com"
strUsername = "cn=Administrator,cn=Users,dc=amer,dc=mycorp,dc=com"
strPassword = InputBox("Enter the Administrator password","Password entry box")
Set objNamespaceLDAP = GetObject("LDAP:")
Set objMyObject = objNamespaceLDAP.OpenDSObject(strPath, _
strUsername, strPassword, _
ADS_USE_ENCRYPTION + ADS_SECURE_AUTHENTICATION)
|