I have writen a script that connectst to a list of servers and pulls
some inventory information from them.
The script works as long as I run it from a workstaion on the Domain.
I want to modify the script to work from a machine in the Lab, that is
NOT on the domain.
I have tried attaching to WMI using this code;
strComputer = Trim(objTextFile.Readline)
fName = strComputer
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(fName, _
"\root\default", _
strUser, _
strPassword, _
"MS_409", _
"ntlmdomain:" + strDomain)
objSWbemServices.Security_.ImpersonationLevel = 3
And I get the error "Can not connect via WMI: `424` Object required"
If I remark out the last line
(objSWbemServices.Security_.ImpersonationLevel = 3), I get this;
Can not connect via WMI: `-2147217308` User credentials cannot be used
for local connections
Any ideas??
Have you tried:
Set objSWbemLocator = CreateObject("WbemScripting.SWbemLocator")
Set objSWbemServices = objSWbemLocator.ConnectServer(fName, _
"\root\default", _
strUser, _
strPassword)
I've never used more than the 4 parameters. I've never seen the
impersonationLevel either. Also fName cannot be the local computer.
--
Richard
Microsoft MVP Scripting and ADSI
Hilltop Lab web site - http://www.rlmueller.net
--
Thanks, I'll give it a try