Set objRootDSE = GetObject("LDAP://RootDSE")
objCommand.CommandText = "SELECT name, operatingSystem " &_
"FROM 'LDAP://" & objRootDSE.Get("defaultNamingContext") &_
"' WHERE objectClass='computer' AND (operatingSystem='Windows Server 2003*' OR operatingSystem='*2000 Server*')"
Set objRootDSE = Nothing
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
From novice to tech pro — start learning today.
The account you are running the script on will need to have rights in both domains.
I don't have a way to test this, but I think it'll work.
Open in new window