Skip to content
ohsudo, Home
Windows

Windows "The RPC server is unavailable" (0x800706BA): how to find what blocks it

Fix "The RPC server is unavailable" (0x800706BA, error 1722): check the name, port 135, the dynamic ports, the firewall rules and the RPC services, step by step.

Intermediate4 min readApplies to Windows Server 2016+ · Windows 10 · Windows 11 · Active Directory · WMI · PowerShell

by OhSudo ··

Get-WmiObject : The RPC server is unavailable.

Many programs add the code: The RPC server is unavailable. (Exception from HRESULT: 0x800706BA). The same failure has other faces too: error 1722, dcdiag or repadmin reporting replication errors, a domain join that fails, or a management console that can’t connect.

Don’t be misled by the wording: it rarely means RPC is broken. It nearly always means your computer couldn’t reach the other one on the ports RPC uses. And those are two sets of ports, which is why the usual quick test can pass while the error stays.

How RPC connects

  1. The client connects to TCP 135, the endpoint mapper, and asks which port the service is on.
  2. The answer is a dynamic port, by default in 49152–65535.
  3. The client connects to that port.

A firewall that allows 135 but not the dynamic range gives exactly this error.

  1. Clientasks the endpoint mapper
  2. TCP 135answers: use port 49xxx(works)
  3. Dynamic port49152–65535, blocked(breaks here)
RPC uses two sets of ports: 135 to ask where the service is, then a dynamic port to reach it. A firewall that allows 135 but not the dynamic range gives exactly this error.

TL;DR

Terminal window
Resolve-DnsName server01 # the right address?
Test-NetConnection server01 -Port 135 # the endpoint mapper
Get-Service RpcSs, RpcEptMapper, DcomLaunch, Winmgmt # on the target
Enable-NetFirewallRule -DisplayGroup "Windows Management Instrumentation (WMI)" # on the target

1. Are you talking to the right machine?

A stale DNS record sends you to a machine that isn’t there, or isn’t the one you meant:

Terminal window
Resolve-DnsName server01
ping server01

On the target, compare with ipconfig. Also try the IP address instead of the name: if that works and the name doesn’t, it’s DNS. Run ipconfig /flushdns on the client and fix the record. In a domain, ipconfig /registerdns on the target usually does it.

2. Test port 135

Terminal window
Test-NetConnection server01 -Port 135

TcpTestSucceeded : True means the first step works. False means the machine is off, or a firewall on the way blocks it, or the service is down (section 4).

Our Port Lookup has an entry for 135, and why it should never be open to the internet.

3. Test the dynamic ports

Find which port the service got. portqry, a free Microsoft tool, asks the endpoint mapper directly:

Terminal window
portqry -n server01 -e 135

It lists the services with their ports, for example ncacn_ip_tcp:server01[49668]. Test one of them:

Terminal window
Test-NetConnection server01 -Port 49668

If 135 passes and this fails, you’ve found it: a firewall between the machines blocks the dynamic range. Open 49152–65535 from the management machines, on any network firewall in the path, in a cloud security group, and on the target’s firewall.

The range can differ. To see it on the target:

Terminal window
netsh int ipv4 show dynamicport tcp

4. Check the services on the target

Run these on the target, or through the console if you can’t reach it:

Terminal window
Get-Service RpcSs, RpcEptMapper, DcomLaunch, Winmgmt | Format-Table Name, Status, StartType

The first three must be Running, and they’re not something you stop by accident. If they aren’t, the machine has a bigger problem, so check the System event log. Winmgmt is the WMI service:

Terminal window
Start-Service Winmgmt

5. Check the Windows Firewall on the target

Windows ships with rule groups for this, turned off on many networks:

Terminal window
Enable-NetFirewallRule -DisplayGroup "Windows Management Instrumentation (WMI)"
Enable-NetFirewallRule -DisplayGroup "Remote Service Management"
Enable-NetFirewallRule -DisplayGroup "Remote Event Log Management"

Enable only what you use. To see which network profile applies, since a rule might only cover Domain while the machine thinks it’s on Public:

Terminal window
Get-NetConnectionProfile

A domain-joined machine showing Public usually couldn’t reach a domain controller when its network came up.

6. On domain controllers

For replication errors, run on the domain controller:

Terminal window
dcdiag /test:connectivity /test:replications
repadmin /showrepl
repadmin /replsummary

Domain controllers also need DNS working between them, Kerberos (TCP/UDP 88), LDAP (389) and SMB (445), besides RPC. A wide clock difference breaks Kerberos, so check w32tm /query /status as well. If a machine has lost its place in the domain instead, see the trust relationship failed.

7. Skip DCOM: use WinRM

Get-WmiObject uses DCOM, and needs those dynamic ports. Get-CimInstance uses WinRM, one fixed port (TCP 5985, or 5986 with TLS), which is far easier on firewalls:

Terminal window
Test-NetConnection server01 -Port 5985
Get-CimInstance Win32_OperatingSystem -ComputerName server01

Get-WmiObject doesn’t even exist in PowerShell 7, so it’s worth moving anyway. WinRM is on by default on Windows Server. On a client, run Enable-PSRemoting once.

Warning

Don’t turn off the whole firewall to “fix” this, and don’t expose 135 or the dynamic range outside your internal network. Open them only from the machines that manage this one.

Shell, we have a problem!

Similar, but different: Access is denied (0x80070005) means you got through and lack the rights, so the network is fine. The specified domain either does not exist or could not be contacted is DNS. The RPC server is too busy (0x800706BB) means the service answered, and is overloaded. And to tell a blocked port from a closed one in general, see “Connection timed out” vs “Connection refused”.

Found this useful? Share it.

Found a mistake? Let us know at contact@ohsudo.com.

Tools

Try it yourself

Articles

Related articles