gpt4 book ai didi

windows - PowerShell:使用 Invoke-Command 执行命令时出错?

转载 作者:可可西里 更新时间:2023-11-01 12:42:47 24 4
gpt4 key购买 nike

我正在尝试在远程服务器上执行以下语句:

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(要启用它请阅读我在您的回答中的评论)

关于windows - PowerShell:使用 Invoke-Command 执行命令时出错?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7331844/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com