What Can I If an Error Is Reported After a Script Is Executed, Indicating that the Remote Server Fails to Be Connected and the Login Credential Information Is Correct?
Symptom
After the script was executed, the error message "[ERROR] Failed to update hosts on xxx.xxx.x.xx: [xxx.xxx.x.xx] Failed to connect to the remote server xxx.xxx.x.xx. For details, see the about_Remote_Troubleshooting topic" was displayed.
Possible Causes
The WinRM service on the remote server is not started or is incorrectly configured.
Solution
- Check whether the executor can ping the remote server. If the ping operation succeeds, go to step 2.
- Check whether port 5985 used by the WinRM service on the remote server is open to the executor. If it is, go to step 3.
- Check whether the login credential of the remote server is correct. After confirming that the credential is correct, perform the following steps.
- Log in to the remote server that fails to be connected and run PowerShell as administrator.
- Run the following command to run the script again:
Enable-PSRemoting -Force
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.