Link to home
Start Free TrialLog in
Avatar of sevzas
sevzasFlag for United States of America

asked on

Get-WmiObject win32_operatingsystem not working properly thru Windows XP Firewall

I'm trying to reboot a host remotely using windows powershell.  I use

Get-WmiObject win32operatingsystem -computername MyHost

and the error I see:

Get-WmiObject : The RPC server is unavailable. (Exception fom HRESULT:0x800706BA)

I've been able to track down the cause: it's the Windows XP firewall on MyHost.  Disabling the firewall makes it work.

So I've been trying to set up the right exception and I'm running into a problem.  At minimum I needed to open port 135 TCP.  But making this work requires another port to be opened, but that port seems to be changing every time I reboot MyHost.  It's in the range of 1090-1160.  I established this fact by looking at the firewall logs.  When I open the second port it starts to work, but after a reboot, that port changes.  I see from netstat and tasklist commands that svchost.exe is listening on that port.

I really want to keep the firewall on.

I realize this is a tough problem.  Has anyone seen this and has a work-around?

Perhaps:

- a way to specify an exception for multiple ports in the Firewall
- a way to require svchost.exe to use the same port
Avatar of Jared Luker
Jared Luker
Flag of United States of America image

Is file and print sharing enabled?  I have problems doing anything remotely on my machines at work if that service is disabled.
Avatar of sevzas

ASKER

File and Printing is enabled.  The problem is centered around getting the ports opened reliably in the firewall.
ASKER CERTIFIED SOLUTION
Avatar of sevzas
sevzas
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial