Share via


PowerShell Tip: Invoke-Command on Remote Machines

Summary

PowerShell Tip: Invoke-Command on Remote Machines

Error

[SPServer] Connecting to remote server SPServer 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 configure the WinRM service: "winrm quickconfig". For more information, see the about_Remote_Troubleshooting Help topic. + CategoryInfo : OpenError: (SPServer:String) [], PSRemotingTransportException + FullyQualifiedErrorId : CannotConnect,PSSessionStateBroken

Help

help about_Remote_Troubleshooting

help Invoke-Command -Detailed

help Invoke-Command -Examples

help Invoke-Command -Full

Solution

On the remote machine run 'WinRM QuickConfig'

Winrm QuickConfig

 Enjoy PowerShell :)