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

aik 20 Reputation points


I have problem with this error which is quite common, but in my case there is strange behavior. This error occurs intermittently.

My scenario:

I have server A from where I run PS remoting to server B. PS script deploys virtual machine (lets call it C) - exports template, imports, starts it and then renames it. But when comes on rename command, it sometimes fails with error (names and IPs are changed to B and C):

##[error]Cannot establish the WMI connection to the computer 'C' with the following error message: The RPC server

is unavailable. (Exception from HRESULT: 0x800706BA).

+ CategoryInfo          : OperationStopped: (**C** :String) [Rename-Computer], InvalidOperationException

+ FullyQualifiedErrorId : RenameComputerException,Microsoft.PowerShell.Commands.RenameComputerCommand

+ PSComputerName        : **B**

Do you have any idea why it sometime passes and sometime fails? The ratio pass:fail is around 7:3.

In case I run renaming manually directly on B, it fails sometimes too.

Thank you!

A Windows technology providing a hypervisor-based virtualization solution enabling customers to consolidate workloads onto a single server.
2,367 questions
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
1,551 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. SChalakov 10,156 Reputation points MVP


    the error is actually pretty clear - something is preventing the RPC connection from happening. What bothers me is that this is intermittent. Usually you can either do a RPC call or you can't.

    Let me first say that RPC connection errors are related to the RPC protocol, which simply put has two phases - the fist being kind of negotioation on port 135 and the 2nd being the actual conversation over a random port from the dynamic port range (49152 to 65535).

    So you should first make sure the corresponding FW rules are allowionig this, although I will assume that this is already the case as you mentioned that you can make the connection at some point.

    Can you please check the the status of the "Remote Registry Service" as this happens? Do this on boths sides, please. Any errors, any service crashes or so?

    Please check also the System and Application event logs, do you see any related events there?

    What is the exact error when you try renaming direclty on B?

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
    Stoyan Chalakov

  2. Rich Matheisen 42,906 Reputation points

    If you're renaming the machine and rebooting it you're going to lose the connection.

    0 comments No comments