Hi
i'm trying to return a list of all users in my companies active directory.
i have :
...but i get the error message "There is no such object on the server"
anyone know what i'm doing wrong?
Thanks.
i'm trying to return a list of all users in my companies active directory.
i have :
Code:
Private Sub Command2_Click()
Set objConnection = CreateObject("ADODB.Connection")
Set objCommand = CreateObject("ADODB.Command")
objConnection.provider = "ADsDSOObject"
objConnection.Open "Active Directory Provider"
objCommand.ActiveConnection = objConnection
objCommand.Properties("Page Size") = 1000
objCommand.CommandText = _
"<LDAP://dc=ms1,dc=dddltd, dc=co, dc=uk>;(objectcategory=user);Name;Subtree"
Set objRecordset = objCommand.Execute
While Not objRecordset.EOF
Debug.Print objRecordset.Fields("givenname") & "," & objRecordset.Fields("sn")
objRecordset.MoveNext
Wend
objConnection.Close
End Sub
...but i get the error message "There is no such object on the server"
anyone know what i'm doing wrong?
Thanks.