When you use powershell to run a script to call WMI to remotely start a machine:
"The RPC server is unavailable. (exception from hresult: 0x800706ba)" error may occurs when deploying VNC to a remote computer or when using built-in management tools.
There can be a few reasons for this error:
The remote computer is blocked by the firewall.
Solution: Open the Group Policy object editor snap-in (gpedit. MSC) to edit the Group Policy object (GPO) that is used to manage Windows Firewall settings in your organization. open Computer Configuration, Open Administrative Templates, open network, open network connections, Open Windows Firewall, and then open either Domain Profile or standard profile, depending on which profile you want to configure. enable the following exception: "Allow remote administration exception" and "Allow file and printer sharing exception ".
Host Name or IP address is wrong or the remote computer is shutdown.
Solution: verify correct host name or IP address.
The "TCP/IP NetBIOS Helper" service isn' t running.
Solution: verity that "TCP/IP NetBIOS Helper" is running and set to auto start after restart.
The "Remote Procedure Call (RPC)" service is not running on the remote computer.
Solution: verity that "Remote Procedure Call (RPC)" is running and set to auto start after restart.
The "Windows Management Instrumentation" service is not running on the remote computer.
Solution: verity that "Windows Management Instrumentation" is running and set to auto start after restart.
The first solution can basically solve the problem. The following is a script for remotely restarting a Machine Using WMI.
# Define input parameters Param ([String] $ filename = $ ( Throw "Filename is required! " ) Write-host "Reading computer names from $ FILENAME" # Read File $ Computers = Get-content $ filenamewrite-host "Restarting computers :" $ Computers Foreach ($ Computer In $ Computers ){ # Connect to WMI $ WMI = Get-wmiobject-class "Win32_operatingsystem" '-Namespace "Root \ cimv2" -Computer $ computer# Add privileges # $ WMI. psbase. Scope. Options. enableprivileges = $ true # Restart computer Foreach ($ Item In $ Wmi) {$ WMI. Reboot () Write-host "Restarted" + $ Computer }}