Skip to content
The RPC server is unavailable

The RPC server is unavailable

DodaTech 3 min read

The “RPC server is unavailable” error in PowerShell means a remote call to another machine failed because the target could not be reached or refused the connection.

What It Means

PowerShell relies on RPC (Remote Procedure Call) for many remote operations — WMI queries, remote registry access, certain administrative cmdlets, and COM/DCOM connections. When you run Get-WmiObject -ComputerName Server01 or Get-Service -ComputerName Server01, PowerShell makes an RPC connection to the target. If the target is unreachable, firewalled, or not running the required services, Windows returns the “RPC server is unavailable” error.

Why It Happens

  • The remote computer is turned off, disconnected from the network, or has a different IP address.
  • A firewall (Windows Firewall, third-party, or network firewall) blocks RPC ports (135 TCP, dynamic RPC ports).
  • The Remote Procedure Call (RPC) service or RPC Endpoint Mapper is not running on the remote machine.
  • DCOM is disabled or restricted on the target computer.
  • Network Discovery and File and Printer Sharing are turned off.
  • WinRM is configured incorrectly or not running on the target.
  • IPv6 is enabled but the network does not support it, causing resolution delays.

How to Fix It

1. Verify network connectivity

# Test basic connectivity
Test-Connection -ComputerName Server01 -Count 2

# Test if port 135 is open
Test-NetConnection -ComputerName Server01 -Port 135

2. Check that the RPC services are running (on the remote machine)

# From the remote machine (or via remote PowerShell)
Get-Service -Name RpcSs, RpcEptMapper | Format-Table Name, Status

# Start them if stopped
Start-Service -Name RpcSs, RpcEptMapper

3. Configure Windows Firewall for RPC

# On the remote machine, enable the RPC endpoint mapper rule
 netsh advfirewall firewall set rule group="Remote Administration" new enable=Yes

# Or open port 135 specifically
New-NetFirewallRule -DisplayName "RPC Port 135" -Direction Inbound `
    -Protocol TCP -LocalPort 135 -Action Allow

4. Enable DCOM on the remote machine

# Check DCOM status
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Ole" -Name EnableDCOM

# Enable DCOM
Set-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Ole" -Name EnableDCOM -Value "Y"

5. Use WinRM as an alternative to RPC

# Check WinRM configuration
Test-WSMan -ComputerName Server01

# Enable WinRM if needed
Enable-PSRemoting -Force

6. Try CIM/WMI with alternate protocol

# Instead of Get-WmiObject (which uses RPC), try Get-CimInstance
Get-CimInstance -ClassName Win32_Service -ComputerName Server01

# CIM uses WS-Management (WinRM) by default, which is more firewall-friendly
What ports does RPC use besides port 135?
Port 135 is the RPC Endpoint Mapper. After connecting, RPC negotiates dynamic TCP ports in the range 49152–65535 (Windows Vista/2008 and later) or 1024–5000 (older systems). This makes firewalling RPC difficult — you either open a wide port range or use IPsec for secure RPC communication. WinRM (port 5985/5986) is much easier to firewall.
Why does RPC work locally but not remotely?
Local RPC calls use inter-process communication (IPC) within the same machine and do not require network ports. Remote RPC calls require network connectivity, DNS resolution, firewall rules, and the RPC services to be running on both machines. If any of those conditions fail, remote RPC fails while local calls continue working.
Should I migrate from WMI to CIM for remote management?
Yes — CIM (Get-CimInstance) uses WS-Management (WinRM) over HTTP/HTTPS, which uses fixed ports (5985/5986), supports encryption, and is easier to configure through firewalls. Microsoft has deprecated Get-WmiObject in PowerShell 7, and all new development should use CIM cmdlets for remote management tasks.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro