Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can not connect via WMI: `424` Object required

139 views
Skip to first unread message

OldDog

unread,
Jan 31, 2007, 5:50:37 PM1/31/07
to
Hi,

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??

Richard Mueller [MVP]

unread,
Jan 31, 2007, 6:05:41 PM1/31/07
to

"OldDog" <michael....@wellsfargo.com> wrote in message
news:1170283837.5...@k78g2000cwa.googlegroups.com...

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
--


OldDog

unread,
Jan 31, 2007, 7:43:40 PM1/31/07
to
On Jan 31, 5:05 pm, "Richard Mueller [MVP]" <rlmueller-
NOS...@ameritech.NOSPAM.net> wrote:
> "OldDog" <michael.r.felk...@wellsfargo.com> wrote in message
> --- Hide quoted text -
>
> - Show quoted text -

Thanks, I'll give it a try

0 new messages