I have an ADO query that works fine with Windows Server 2003:
dim strQuery strQuery = "LDAP://dc=Windows2003DC,dc=COM;(objectCategory=user);name,sAMAccountName;subtree" Set objConnection = CreateObject("ADODB.Connection") Set objCommand = CreateObject("ADODB.Command") objConnection.Open "Provider=ADsDSOObject;" objCommand.ActiveConnection = objConnection objCommand.CommandText = strQuery Set objRecordSet = objCommand.Execute Do until objRecordSet.EOF WScript.Echo objRecordSet("sAMAccountName") objrecordset.Movenext loop objConnection.close
But when I run the same script, but make the following change:
strQuery = "<LDAP://dc=Windows2008DC,dc=COM>;(objectCategory=user);name,sAMAccountName;subtree"
I get an error that says "There is no such object on the server"
I do not have domain rights for the domain, but if I can run this query for Windows 2003, I shoudl be able to do so with 2008.