zoukankan      html  css  js  c++  java
  • WinRM不起作用 Connecting to remote server failed with the following error message : WinRM cannot complete the operation

    当我运行下面的 powershell  脚本时:

    $FarmAcct = 'domainuser' 
    $secPassword = ConvertTo-SecureString 'aaa' -AsPlaintext -Force 
    $global:farmCredential_ = New-Object System.Management.Automation.PsCredential $FarmAcct,$secPassword
    Invoke-Command -ComputerName "172.21.4.14" -Credential $global:farmCredential_ -Scriptblock { write-host "HELLO"}

    得到下面的error:

    Connecting to remote server 172.21.4.14 failed with the following error message : WinRM cannot 
    complete the operation. Verify that the specified computer name is valid, that the computer is accessible over the 
    network, and that a firewall exception for the WinRM service is enabled and allows access from this computer. By 
    default, the WinRM firewall exception for public profiles limits access to remote computers within the same local 
    subnet. For more information, see the about_Remote_Troubleshooting Help topic.
        + CategoryInfo          : OpenError: (172.21.4.14:String) [], PSRemotingTransportException
        + FullyQualifiedErrorId : WinRMOperationTimeout,PSSessionStateBroken

    我已经安装了 winrm feature 并且执行了 "enable-psremoting -force".

    解决方法:

     

    运行 netsh winhttp show proxy 看是否有proxy,如果有用 netsh winhttp reset proxy 重置下,就好了。

     

    http://www.ldap389.info/en/2011/04/14/the-winrm-client-cannot-complete-the-operation-within-the-time-specified/

  • 相关阅读:
    HDOJ 1284 钱币兑换问题
    WA : csu1019 simple line editor
    HDOJ1232 并查集
    最长回文子串
    Where's Waldorf?
    csu 1148 词典
    csu 1011 Counting Pixels
    Product:java高精度乘法
    内置类型开方
    csu 1019 Simple Line Editor
  • 原文地址:https://www.cnblogs.com/fengwenit/p/3606927.html
Copyright © 2011-2022 走看看