首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >令人困惑的Powershell行为

令人困惑的Powershell行为
EN

Stack Overflow用户
提问于 2011-09-02 22:57:50
回答 7查看 52.8K关注 0票数 21

我对远程执行powershell命令有点困惑。我有一个名为ServerA的测试服务器(win2k8-r2-sp1),它正确地启用了powershell remoting。从我的dev机器(win2k8-r2-sp1),我能够正确地远程执行powershell命令。但是,当我尝试从另一个名为ServerB (win2k8-r2)的服务器执行相同的命令时,我得到以下错误

[ServerA] Connecting to remote server 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: (:) [], PSRemotingTransportException + FullyQualifiedErrorId : PSSessionStateBroken

这三台机器都在同一个域中。我的困惑是,在我的开发机器上,我完全能够连接到ServerA并执行命令。

ServerB没有SP1的事实会有什么不同吗?请给我建议。我使用相同的域帐户,该帐户在所有3台服务器上都有管理员权限。

我正在尝试的命令是Invoke-Command -ComputerName ServerA -ScriptBlock {Get-UICulture}

请帮帮忙。

谢谢

EN

回答 7

Stack Overflow用户

发布于 2011-09-02 23:18:15

从ServerB运行winrm quickconfigEnable-PSRemoting -force

验证服务是否正在使用get-service winrm运行

http://technet.microsoft.com/en-us/magazine/ff700227.aspx

另外,从您本地的dev box运行以下命令:

代码语言:javascript
复制
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
票数 29
EN

Stack Overflow用户

发布于 2012-12-13 22:15:13

在过去为远程powershell工作的机器上,我也遇到过同样的问题。在我的例子中,解决方案是清除安全日志。它已经满了,我认为这阻止了powershell建立适当的安全连接。

票数 5
EN

Stack Overflow用户

发布于 2016-12-08 02:07:32

以下操作解决了我的问题:

您必须清空iplisten列表,该列表可以使用以下CMD命令进行检查:

代码语言:javascript
复制
netsh http show iplist

或者,如果存在任何其他地址,则将环回地址添加到其中:

代码语言:javascript
复制
netsh http add iplisten 127.0.0.1
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7285310

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档