Idealy I'd like to simple link a table in ms access. As far as I can tell that's not possible, so this is what I have been trying, but it say's "Table does not exist."
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT Name FROM 'LDAP://dc=mydomain,dc=COM' WHERE objectCategory='user'"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
MsgBox objRecordSet.Fields("Name").Value
Wscript.Echo objRecordSet.Fields("Name").Value, objRecordSet.Fields("altRecipient").Value
MsgBox objRecordSet.Fields("Name").Value
objRecordSet.MoveNext
Loop
Const ADS_SCOPE_SUBTREE = 2
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.Provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
Set objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objCommand.CommandText = _
"SELECT Name FROM 'LDAP://dc=mydomain,dc=COM' WHERE objectCategory='user'"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Do Until objRecordSet.EOF
MsgBox objRecordSet.Fields("Name").Value
Wscript.Echo objRecordSet.Fields("Name").Value, objRecordSet.Fields("altRecipient").Value
MsgBox objRecordSet.Fields("Name").Value
objRecordSet.MoveNext
Loop