Scripting administration. RPC Unavailable.

alphard

Distinguished
Dec 27, 2004
8
0
18,510
Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

Hi again.

I am writing a remote administration script and have run into a little
problem where I could use some help.

Error message: "SWbemLocator: The RPC server is unavailable."
I am using WBEMScripting.SWBEMLocator to connect to computers across several
subnets and domain/non-domain computers (NT/XP).

Computers:
C1 - domain\computer1 (subnet_1) XP SP2
C2 - domain\computer2 (subnet_1) XP SP2
C3 - domain\computer3 (subnet_2) XP SP2

I can connect and run script from C2 against C1 but I cannot run it from C3
against C1 (get RPC error). All computers have firewall enabled but i have
used gpedit to set the exception to remote administration IP-s of C2 and C3
(both domain and standard settings). Also all computers have WMI and RPC
services running.

As I see it either the problem is on machine C3 where I am missing some
settings or C1 needs some RPC settings tweeked. Is there a need to specify
IP-s to RPC if the subnet is different? Also I am using local administrator
accounts to log on to the computers as the script has to work across several
domain/non-domains/subnets.

The script I am using:
--------------------------------
compname = "Cad13"
Set locator = CreateObject("WBEMScripting.SWBEMLocator")
Set objWMIService = locator.ConnectServer(compname, "root/cimv2", _
"Cad13\accountname", "password")
objWMIService.Security_.ImpersonationLevel = 3
--------------------------------

Sry for cross posting with the general thread.

Any advice would be welcome.
Thank you,
Tarmo
 

alphard

Distinguished
Dec 27, 2004
8
0
18,510
Archived from groups: microsoft.public.windowsxp.security_admin (More info?)

Greets,

I have solved this problem for now. I can make th script run by connecting
to the remote machine via the IP not computer name. probably some DNS config
problem? anyways it works now and thats all that matters.

Alphard