[Date Prev][Date Next] [Chronological] [Thread] [Top]

How to access OpenLDAP using VBScript

I could not find this anywhere on the Internet, so I am posting it to this
list so someone else may find it useful in the future.

How to Access OpenLDAP using VBScript

Dim oConn,oRS,vSearch,vCount,vMailList,vValue,vProblem,vMsg

' Set the vStatus flag to True...
vProblem = False

' Build the LDAP search condition...
vSearch = "(sn=Leeds)"

' Instantiate the connection and log in to OpenLDAP
Set oConn = CreateObject("ADODB.Connection")
oConn.Provider = "ADsDSOObject"
oConn.Open "ADs Provider", "cn=mail_verify,ou=accounts,dc=mckee,dc=com",

' Execute the search...
Set oRS = oConn.Execute("<LDAP://leconte/dc=com/dc=mckee>;" & vSearch &_

' Create an array of returned values
vCount = 1
While not oRS.EOF

   For Each vValue in oRS.Fields(0).value
      WScript.Echo vValue

vCount = vCount + 1