RPC Server is Unavailable Error in PowerShell

The “RPC Server is Unavailable” error in PowerShell can occur when your PowerShell session cannot establish a Remote Procedure Call (RPC) connection to a target machine.

RPC (Remote Procedure Call) is a Windows service that enables communication between processes on different computers across a network.

When PowerShell throws this error, it typically appears as:

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

This error commonly occurs when using PowerShell cmdlets with the -ComputerName parameter, such as:

  • Get-WmiObject
  • Get-CimInstance
  • Invoke-Command
  • Enter-PSSession

RPC Server is Unavailable Error

PowerShell relies on RPC to run commands remotely, access management instruments like WMI (Windows Management Instrumentation), or rename computers in Active Directory environments.

RPC primarily uses TCP port 135 and a range of dynamic ports (1024–65535) for communication. Kerberos or NTLM authentication secures the RPC connection in corporate networks. If this connection fails, Windows throws the “RPC server is unavailable” error with an HRESULT code like 0x800706BA.

There are various reasons why the error might occur.

Solution-1: RPC service not running

The error might come if the RPC and related services are not running. The RPC service and its dependencies must be running on both machines.

Open PowerShell or Run dialog (Win + R) and enter services.msc. Check these services on both client and target machines:

  • Remote Procedure Call (RPC)
  • DCOM Server Process Launcher
  • RPC Endpoint Mapper

Ensure each has:

  • Startup type set to Automatic
  • Status is Running

If a service isn’t running, right-click → Start. Restart the machine after changes.

You can also run the following PowerShell cmdlet to check this:

# Check RPC service status locally
Get-Service -Name "RpcSs" | Format-Table Name, Status, StartType

# Check RPC service on remote machine (if accessible)
Get-Service -Name "RpcSs" -ComputerName "TargetServer"

# Start RPC service if stopped
Start-Service -Name "RpcSs"

# Check WMI service
Get-Service -Name "Winmgmt" | Format-Table Name, Status, StartType

Check out: Delete User Profiles Using PowerShell in Windows 11

Solution-2: Network Connectivity Issues

Check if there are any network connectivity issues. Below is the PowerShell cmdlet you can use to check:

Start with basic network tests to ensure the target system is reachable:

# Test basic connectivity
Test-Connection -ComputerName "TargetServer" -Count 4

# Test specific RPC port
Test-NetConnection -ComputerName "TargetServer" -Port 135

# Verify DNS resolution
Resolve-DnsName "TargetServer"

Solution-3: Firewall Blocking RPC Traffic

Windows Firewall or third-party firewalls may block TCP 135 or dynamic RPC port ranges, preventing connections.

Ensure firewall rules permit RPC communication:

  • Temporarily disable Windows Firewall with:
netsh advfirewall set allprofiles state off
  • Test the PowerShell RPC command again.

If it works, create inbound and outbound firewall rules to allow:

  • TCP port 135 (RPC endpoint mapper)
  • Dynamic RPC ports (default 49152–65535 on newer Windows versions)

Re-enable firewall after configuration:

netsh advfirewall set allprofiles state on

Check third-party antivirus/firewall apps for similar blocking rules.

Firewall configuration is crucial for RPC communication:

# Enable RPC through Windows Firewall (run on target machine)
netsh advfirewall firewall set rule group="Windows Management Instrumentation (WMI)" new enable=yes

# Enable RPC core functionality
netsh advfirewall firewall set rule group="Remote Administration" new enable=yes

# Alternative: Create specific RPC rule
New-NetFirewallRule -DisplayName "RPC-In" -Direction Inbound -Protocol TCP -LocalPort 135 -Action Allow

Check out Track User Login History on Windows Using PowerShell

Solution-4: Enable DCOM and Verify Registry Settings

Ensure DCOM is enabled as RPC relies on it:

  • Run dcomcnfg (Component Services)
  • Navigate: Component Services → Computers → My Computer → Properties → Default Properties tab
  • Check Enable Distributed COM on this computer

Verify registry key at:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\OLE

Set EnableDCOM to "Y".

Solution 5: Fix WMI Repository Issues

WMI corruption often causes RPC errors:

# Stop WMI service
Stop-Service -Name "Winmgmt" -Force

# Reset WMI repository
cd C:\Windows\System32\wbem
winmgmt /resetrepository

# Restart WMI service
Start-Service -Name "Winmgmt"

# Verify WMI functionality
Get-WmiObject -Class Win32_OperatingSystem

Read Set the Default Printer Using PowerShell in Windows

Solution 6: Configure DCOM Settings

DCOM configuration affects RPC communication:

# Run DCOM configuration utility
dcomcnfg.exe

Navigate to:

  1. Component Services → Computers → My Computer → DCOM Config
  2. Find Windows Management Instrumentation
  3. Right-click → Properties → Security
  4. Ensure appropriate users have Launch and Activation Permissions

In this tutorial, I explained how to fix the error “the rpc server is unavailable exception from hresult: 0x800706ba”. I have shown different scenarios and how to fix it.

You may also like:

Leave a Comment

100 PowerShell cmdlets download free

100 POWERSHELL CMDLETS E-BOOK

FREE Download an eBook that contains 100 PowerShell cmdlets with complete script and examples.