I'm trying to execute the following statement on remoter server:
Invoke-Command -ComputerName server1 -ScriptBlock {Get-Process}
but I get an error message:
[server1] Connecting to remote server failed with the following error message : The client cannot connect to the destination specified in the request. Verify that the serv
ice 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 configure the WinRM service: "winrm quickconfig". For more
information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (:) [], PSRemotingTransportException
+ FullyQualifiedErrorId : PSSessionStateBroken
What is the reason for this and how to fix it?
Description. The Invoke-Command cmdlet runs commands on a local or remote computer and returns all output from the commands, including errors. Using a single Invoke-Command command, you can run commands on multiple computers. To run a single command on a remote computer, use the ComputerName parameter.
Description. The Invoke-Item cmdlet performs the default action on the specified item. For example, it runs an executable file or opens a document file in the application associated with the document file type.
There is 2 basical reason:
1) remote computer has not Powershell installed
2) PSremoting is not enabled on remote PC (to enable it read my comment in you answer)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With