Scripting remote WMI problem

G

Guest

Hi.

I need to run scripts on remote computers but i am not able to. They run
locally fine but when i try to connect to another computer on my network i
get
Permission denied: 'GetObject'. I took the job recently so i dont know
exactly the local setup but it was a mess.

All computers are XP Pro, SP2. They are connected on a domain. Both
computers have an administrator account under the same name and same
password.

I am aware of the firewall issue with SP2 default settings so i disabled
firewalls on both machines just so see if it is the part that causes
problems. (did it from control panel -> windows firewall -> disable.. dont
know if it turns off all its features) No Third party firewall is present.
Also I am able to ping the other machine fine if that counts for anything.

Before that I already used gpedit to activate remote administration for both
machines on the windows firewall in both domain and standard profile with *
ip mask for troubleshooting purposes.

Made sure following services are running on both machines:
- DCOM Server Process Launcher
- Remote Procedure Call (RPC)
- Remote Procedure Call (RPC) Locator
- Windows Management Instrumentation
- Windows Management Instrumentation Driver Extensions

The testscript i am using is:
' START
strComputer = "Cad13"
Set objWMIService = GetObject("winmgmts:"_
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colRunningServices = objWMIService.ExecQuery _
("Select * from Win32_Service")
For Each objService in colRunningServices
Wscript.Echo objService.DisplayName & VbTab & objService.State
Next
' END

I am probably missing something very simple. Sigh. Could you help please?
Tarmo
 
T

Torgeir Bakken \(MVP\)

Alphard said:
Hi.

I need to run scripts on remote computers but i am not able to. They run
locally fine but when i try to connect to another computer on my network i
get
Permission denied: 'GetObject'. I took the job recently so i dont know
exactly the local setup but it was a mess.

All computers are XP Pro, SP2. They are connected on a domain. Both
computers have an administrator account under the same name and same
password.
Hi

The local administrator account is irrelevant. Be sure your domain
user account is added to the Administrators groups on bot local and
remote computer (or instead of your user account, a domain security
group that your user account is a member of).
 
G

Guest

Thank you for your hasty reply.

It is very possible that this is the problem. Just that the account on my
computer that i know for certain to have admin rights on the domain server
(not mine) is listed only as the member of Administrators group, just as my
personal account. Sry i am new to domain based network.

Anyways since it is the holiday season (Merry soon to be Christmas by the
way) my domain admin is unavailable for a week or 2. Therefore I would like
to know if there is any other way for me to authenticate myself to the remote
computer so that i could test my scripts and later just convert the way i
connect to the other machine. I know in a non domain network there was a way
where one had to send a username/password every time? However I do not know
how to implement this. Is this an option also here? Just a little nudge in
the right direction? :)

Best wishes in any case.
Tarmo
 
T

Torgeir Bakken \(MVP\)

Alphard said:
Anyways since it is the holiday season (Merry soon to be Christmas by the
way) my domain admin is unavailable for a week or 2. Therefore I would like
to know if there is any other way for me to authenticate myself to the remote
computer so that i could test my scripts and later just convert the way i
connect to the other machine. I know in a non domain network there was a way
where one had to send a username/password every time? However I do not know
how to implement this. Is this an option also here? Just a little nudge in
the right direction? :)
Hi

You can connect with explicit user credentials (e.g. the local
Administrator account on the remote computer), using
SWbemLocator.ConnectServer instead of GetObject("winmgmts:...")

IWbemLocator::ConnectServer
http://msdn.microsoft.com/library/en-us/wmisdk/wmi/iwbemlocator_connectserver.asp

Subject: Login with explicit username and password
Newsgroups: microsoft.public.win32.programmer.wmi
http://groups.google.com/groups?th=2b5bcad76f5debaa

Subject: ImpersoantionLevel other than impersonate
Newsgroups: microsoft.public.scripting.wsh
http://groups.google.com/groups?th=89ff50603f12dcfb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top