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 1352. 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, RpcEptMapper3. 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 Allow4. 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 -Force6. 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 Previous
ssh: connect to host ... port 22: Connection refused
Next
TypeError: '...' object is not callable
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro