I wrote this code in ColdFusion to read data from Exchange and am wondering if anyone can help me to code this using Visual Basic Script:
<cfldap
server="insert_my_server_name_here"
username="zzz\zzzzzz"
password="xxxx"
port = "123"
action = "query"
name = "data"
attributes = "company"
filter = "(&(objectclass=group))"
returnAsBinary = "objectSID"
>
I got this far, but it returns a table not found error:
Dim UserID
UserID = "my_user_ID"
Set objConn = CreateObject("ADODB.Connection")
objConn.Provider = "ADsDSOObject"
objConn.Open "Active Directory Provider"
Dim Base, Filter, Attr, Level, Server
Server = "insert_my_server_name_here"
Base = "<LDAP://" & Server & "/DC=dot,DC=com>;"
Filter = "(&(objectClass=user)(objectCategory=person)(samAccountName=" & UserID & "));"
Attr = "distinguishedName;"
Level = "SubTree"
Set RecordSet = objConn.Execute(Base & Filter & Attr & Level)
RecordSet.MoveFirst
While Not RecordSet.EOF
Wscript.echo RecordSet.Fields(0).Value
RecordSet.MoveNext
Wend