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

$FarmAcct = 'domain\user' 
$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/

WinRM不起作用 Connecting to remote server failed with the following error message : WinRM cannot complete the operation的更多相关文章

  1. ionic真机调试Android报错 - could not read ok from ADB Server * failed to start daemon * error: cannot connect to daemon

    在使用真机调试Android程序时,报错如下: could not read ok from ADB Server * failed to start daemon error: cannot con ...

  2. Appium——adb 启动问题Invalid argument: cannot open transport registration socketpair could not read ok from ADB Server failed to start daemon * error: cannot connect to daemon

    adb启动问题:Invalid argument: cannot open transport registration socketpair could not read ok from ADB S ...

  3. nova instance出错:"message": "Proxy error: 502 Read from server failed

    执行 $ nova resize instance1 时候出错: {, "details": " File \"/opt/stack/nova/nova/com ...

  4. “psql: could not connect to server: Connection refused” Error when connecting to remote database

    问题: I am trying to connect to a postgres database installed in a remote server using the following c ...

  5. selenium Remote Server 实现原理

    selenium作为一个出色的web automation框架,被越来越多的企业采用究其原因,框架设计的比较remarkable, 作为一个开源的框架,能够开辟出一套协议,以至于针对app测试的app ...

  6. CHECK_NRPE: Received 0 bytes from daemon. Check the remote server logs for error messages.

    今天,在用icinga服务器端测试客户端脚本时,报如下错误: [root@mysql-server1 etc]# /usr/local/icinga/libexec/check_nrpe -H 192 ...

  7. System.Net.WebException : The remote server returned an error: (415) UNSUPPORTED MEDIA TYPE

    I am having problems with a bit of code that accesses a restful web service. Running this code, it e ...

  8. Call Azure Queue get "The remote server returned an error: (400) Bad Request."

    这几天开始研究Windows Azure, 在使用Azure Queue 的时候,CreateInfNotExists 总是抛出异常 "The remote server returned ...

  9. Request Connection: Remote Server @ 192.229.145.200:80

    录制Loadrunner脚本时,提示: Request Connection: Remote Server @ 192.229.145.200:80   NOT INTERCEPTED!(REASON ...

随机推荐

  1. 使用阿里云cli管理安全组

    相比于python SDK方式,阿里云基于GO SDK开发了一整套CLI工具,可以通过调用RPC API来管理云资源,对编程能力不够的人来说是个福音. 而且,阿里云CLI的文档比SDK的文档更加全面, ...

  2. ACM-ICPC 2018 徐州赛区网络预赛 G. Trace-树状数组-区间修改,单点查询

    赛后和队友讨论了一波,感谢无敌的队友给我细心的讲题 先埋坑 #include<iostream> #include<string.h> #include<algorith ...

  3. 雅思听听app

    最近本人呢,正在紧张的备战雅思考试,因为英语基础很弱,尤其是听力,所以老师推荐了雅思听听这个app,说是特别好使,用了一个多月的,总体来说感觉还是很nice的,但是还有一些小毛病,不过这小毛病瑕不掩瑜 ...

  4. 个人博客作业_week1

    1.<构建之法>的5个问题 1.如何避免在产品开发后期不断有重大修改,导致其他模块的连锁反应? 2.游戏用户有哪些类型? 3.如何衡量软件工程的质量? 4.怎么协调团队里相互间的任务分配? ...

  5. 《Linux内核》第七周 进程的切换和系统的一般执行过程 20135311傅冬菁

    进程的切换和系统的一般执行过程 一.内容总结与分析 进程调度与进程调度时机 进程调度需求的分类: 第一种分类方式: I/O -bound(频繁进行I/O,通常会花很多时间等待I/O操作) CPU-bo ...

  6. jeecg中vaildfrom的复杂的表单校验

    简介 jeecg生成的页面都是使用validfrom组件来确保数据的完整性和准确性. 凡要验证格式的元素均需绑定datatype属性,datatype可选值内置有10类,用来指定不同的验证格式. 如果 ...

  7. MySQL存储和获取数据

    ---恢复内容开始--- 一.MySQL存储引擎? 1.引擎定义 存储引擎其实就是如何存取数据,如何为存储的数据建立索引和如何更新.查询数据等技术的实现方法.因为在关系型数据苦中数据是以表格的形式,所 ...

  8. 自己写的browse.bat与perl写的url_handler.pl的比较

    以前自己也写过Windows下自动打开多个浏览器测试某个URI,提高浏览器兼容性测试效率. 但是写的browse.bat文件还是最基础简陋的 @echo off if '%1'=='-c' ( sta ...

  9. HTML5 Base64_encoding_and_decoding

    https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding In JavaSc ...

  10. [转帖]盖国强:Oracle 路线图

    http://www.eygle.com/archives/2018/12/oracle_database_release_19c_confirm.html 盖总的blog 里面讲了下相关的内容. 很 ...