我对远程执行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}。
请帮帮忙。
谢谢
发布于 2011-09-02 23:18:15
从ServerB运行winrm quickconfig或Enable-PSRemoting -force。
验证服务是否正在使用get-service winrm运行
http://technet.microsoft.com/en-us/magazine/ff700227.aspx
另外,从您本地的dev box运行以下命令:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force发布于 2012-12-13 22:15:13
在过去为远程powershell工作的机器上,我也遇到过同样的问题。在我的例子中,解决方案是清除安全日志。它已经满了,我认为这阻止了powershell建立适当的安全连接。
发布于 2016-12-08 02:07:32
以下操作解决了我的问题:
您必须清空iplisten列表,该列表可以使用以下CMD命令进行检查:
netsh http show iplist或者,如果存在任何其他地址,则将环回地址添加到其中:
netsh http add iplisten 127.0.0.1https://stackoverflow.com/questions/7285310
复制相似问题