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

Answer : Get-WmiObject win32_operatingsystem not working properly thru Windows XP Firewall

The answer is that there is another place to enable special rules for the firewall.  Microsoft has documented this at

http://technet.microsoft.com/en-us/library/bb490616.aspx#EJAA

to launch the Group Policy tool, run "gpedit.msc".  Use the directions in the link above to change the "Allow remote administration exception" to "Allow".
Random Solutions  
 
programming4us programming4us