GetObject error when connecting to remote computer....
- From: Joe <Joe@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 2 Nov 2007 07:56:06 -0700
I have a script that run locally. This script is used to stop and then
restart services
based on a wildcard match. We have services on multiple servers (all are
standalone) that begin with the same characters "TCWeb-". So the error I get
is Error: Permission denied: 'GetObject'
Here's the script:
Set objWMI =
GetObject("winmgmts:{impersonationLevel=impersonate}\\.\root\cimv2")
Set colServices = objWMI.ExecQuery ("Select * From Win32_Service Where Name
Like " & "'" & "TCWeb-%" & "'")
So when I change \\.\root\cimv2 to \\szComputer\root\cimv2 it fails with the
permission denied. Again since all these servers are standalone I need to
provide the username/password to connect with so that I can query and then
restart the services.
How do I do that? Can I supply the username/password in the connection
string?
Thanks.
.
- Follow-Ups:
- Re: GetObject error when connecting to remote computer....
- From: Jeffery Hicks [MVP]
- Re: GetObject error when connecting to remote computer....
- From: Richard Mueller [MVP]
- Re: GetObject error when connecting to remote computer....
- Prev by Date: Re: What could I use?
- Next by Date: Re: logon script: assigning exchange mailbox
- Previous by thread: logon script: assigning exchange mailbox
- Next by thread: Re: GetObject error when connecting to remote computer....
- Index(es):
Relevant Pages
|
|