The RPC server is unavailable. (exception from hresult: 0x800706ba)

Source: Internet
Author: User

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 }}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.