Powershell Connecting to remote server failed with the following error message
Powershell Connecting to remote server $computername failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and co
nfigure the WinRM service: “winrm quickconfig”. For more information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (cls01:String) [], PSRemotingTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionStateBroken
Makale İçeriği
Connecting to remote server failed with the following error message solved
You have taken this error message most becouse your winrm service is not started. If you take Connecting to remote server $computername failed with the following error message : The client cannot connect to the destination specified in the request
I have some solution for that.
Solution-1
Check the winrm service is running or not. If winrm service is not running start the service.
1- Open Powershell with run as administrator
2- Check winrm service is running or not
1 2 3 |
Get-Service -Name winrm |
3- If the service is not running. You can start service via powershell run below command.
1 2 3 |
Get-Service -Name winrm |Start-Service |
Solution-2
You have taken this error message probably Powershell remote signed configuration restrictued or so. If you take Connecting to remote server $computername failed with the following error message : The client cannot connect to the destination specified in the request
Check the Executionpolicy and set as remotesigned.
1- Open Powershell with run as administrator
2- Check your Execution policy configuration below commands
1 2 3 |
Get-ExecutionPolicy |
3- Change your remotesigned as RemoteSigned
I recognized that my executionpolicy configured as restricted. So I’m going to change my executionpolicy as remotesigned
1 2 3 |
Set-ExecutionPolicy RemoteSigned |
4- Check your Execution policy change as remotesigned
1 2 3 |
Get-ExecutionPolicy |
Powershell Connecting to remote server failed with the following error message
Solution-3
Check your domain trust relationship between and client and domain controller.
If above solution is not suit for you. Your domain trust relationship could be dropped. So the solution is this for you.
1- Open Powershell with run as administrator
2- Check your domain relationship between client and dc
1 2 3 |
Test-ComputerSecureChannel |
1 2 3 |
Test-ComputerSecureChannel -Server "192.168.1.10" |
So, if the result is false you can repair and get again trust relationship between client and domain controller below command.
1 2 3 |
Test-ComputerSecureChannel -repair |