Get-WmiObject win32_operatingsystem not working properly thru Windows XP Firewall

Posted on 2009-04-21
Last Modified: 2013-11-16
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?


- a way to specify an exception for multiple ports in the Firewall
- a way to require svchost.exe to use the same port
Question by:sevzas
    LVL 17

    Expert Comment

    by:Jared Luker
    Is file and print sharing enabled?  I have problems doing anything remotely on my machines at work if that service is disabled.

    Author Comment

    File and Printing is enabled.  The problem is centered around getting the ports opened reliably in the firewall.

    Accepted Solution

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

    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".

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Suggested Solutions

    This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
    Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now