The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

tryllz ‎ 96 Reputation points
2021-12-29T10:56:17.813+00:00

Hi,

I'm facing this issue of being unable to shutdown a server remotely, the error is RPC servier is unavailable. After some digging I found out some of the things to look for, one of them being the inbuilt firewall.

I disabled the firewall completely and the script works fine, and the server shuts down. I have 2 servers with same configurations, and settings, however, only 1 shuts down and the other doesn't.

I exported all the firewall rules implemented on both, the server that shutdowns remotely has more rules compared to the one that does not shutdown. The question is which is the rule to look for, I searches all RPC related rules and they are similar in both firewalls.

Stop-Computer -ComputerName 10.10.20.7 -Force -Confirm:$false
Stop-Computer : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:1 char:1

  • Stop-Computer -ComputerName 10.10.20.7 -Force -Confirm:$false
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidOperation: (10.10.20.7:String) [Stop-Computer], COMException
  • FullyQualifiedErrorId : StopComputerException,Microsoft.PowerShell.Commands.StopComputerCommand

Get-WmiObject Win32_ComputerSystem -ComputerName 10.10.20.7
Get-WmiObject : The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:1 char:1

  • Get-WmiObject Win32_ComputerSystem –ComputerName 10.10.20.7
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException
  • FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. tryllz ‎ 96 Reputation points
    2021-12-29T20:56:53.683+00:00

    Hi All,

    Seem to have found the 3 rules (listed in the end) that are missing in the server that does not shutdown remotely. I opened one of them and it said these are pre-defined rules, so I just right-click copied from the server which works, and pasted in the firewall of the server which doesn't, and now I have result from the server with firewall enabled, no RPC related error.

    Get-WmiObject Win32_ComputerSystem -ComputerName 10.10.20.7
    Domain             : vlab.lab
    Manufacturer       : VMware, Inc.
    Model             : VMware7,1
    Name               : D-SRV-VEMB
    PrimaryOwnerName   : Windows User
    TotalPhysicalMemory : 6441435136
    
    Name : FileServer-ServerManager-Winmgmt-TCP-In
    DisplayName : File Server Remote Management (WMI-In)
    Description : Inbound rule to allow WMI traffic to manage the File Services role.
    DisplayGroup : File Server Remote Management
    $_ | Get-NetFirewallPortFilter
    Protocol : TCP
    LocalPort : RPC
    RemotePort : Any
    IcmpType : Any
    DynamicTarget : Any
    
    Name : FileServer-ServerManager-DCOM-TCP-In
    DisplayName : File Server Remote Management (DCOM-In)
    Description : Inbound rule to allow DCOM traffic to manage the File Services role.
    DisplayGroup : File Server Remote Management
    $_ | Get-NetFirewallPortFilter
    Protocol : TCP
    LocalPort : 135
    RemotePort : Any
    IcmpType : Any
    DynamicTarget : Any
    
    Name : FileServer-ServerManager-SMB-TCP-In
    DisplayName : File Server Remote Management (SMB-In)
    Description : Inbound rule to allow SMB traffic to manage the File Services role.
    DisplayGroup : File Server Remote Management
    $_ | Get-NetFirewallPortFilter
    Protocol : TCP
    LocalPort : 445
    RemotePort : Any
    IcmpType : Any
    DynamicTarget : Any
    
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.