Background:
I have
a Windows 8.1 standalone machine (XU_XPS) and a windows 8.1 virtual machine
(XU_VM) on it. I have been successfully able to access to the virtual machine
from the local machine with the following cmdlets:
On
the virtual machine, open PowerShell as an admin and execute the following:
PS C:\> set-item
WSMan:\localhost\Client\TrustedHosts -value XU_XPS
On the local machine, also open PowerShell as an admin and execute
the following:
Enter-PSSession
-computerName XU_VM
Problem:
Now when I tried to execute
the following cmdlet on my local computer, I got an error:
Get-WmiObject -Class win32_process -ComputerName xu_vm
Where xu_vm is the name for
the virtual machine acting as a remote machine.
Get-WmiObject : The RPC
server is unavailable. (Exception from HRESULT: 0x800706BA)
At line:1 char:1
+ Get-WmiObject -Class
win32_process -ComputerName xu_vm
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo
: InvalidOperation: (:) [Get-WmiObject],
COMException
+
FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
This
post suggests to make sure that the "Windows Management
Instrumentation (WMI-In)" rule is enabled in the firewall for the remote
machine, or in an Administrative Command/Powershell prompt run:
netsh advfirewall firewall set
rule group="Windows Management Instrumentation (WMI)" new enable=yes
After executing the
command, when I run the get-wmiObject cmdlet again on the local machine, I observe
inconsistent behaviors. Sometimes, I get the result from cmdlet, other times, I
get the same “The RPC server is unavailable” error message.
Solution:
Download and install the Remote Server Administration Toolsfor Windows 8.1 on the remote machine. After that, it works as expected.