Quantcast
Channel: Directory Services forum
Viewing all articles
Browse latest Browse all 31638

There is no such object on the server - ADO serach on Windows Server 2008

$
0
0

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.



Viewing all articles
Browse latest Browse all 31638

Trending Articles