簡體   English   中英

PowerShell:使用Invoke-Command執行命令錯誤?

[英]PowerShell: error executing command using Invoke-Command?

我正在嘗試在遠程服務器上執行以下語句:

Invoke-Command -ComputerName server1 -ScriptBlock {Get-Process}

但是我收到一條錯誤消息:

[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

這是什么原因以及如何解決?

有兩個基本原因:

1)遠程計算機沒有安裝Powershell

2)遠程PC上未啟用PSremoting(為了使其能夠在您的回答中閱讀我的評論)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM