当我运行下面的 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/

最新文章

  1. requirejs:研究笔记
  2. Android -- 常见控件的小效果
  3. centos 配置 ssl服务
  4. ActiveMQ第一弹:安装与运行
  5. [主席树]SPOJ DQUERY
  6. Magento 使用心得
  7. 第六篇:R语言数据可视化之数据分布图(直方图、密度曲线、箱线图、等高线、2D密度图)
  8. MVC跳转
  9. div和span的区别
  10. DLT(Diagnostic Log and Trace)嵌入式系统程序运行记录
  11. cocoapods的安装和使用以及版本升级遇到的问题
  12. Excel VBA TextBox控件的滚动条不能刷新
  13. 【转载】Centos系统快速部署LNMP环境
  14. 01 Django REST Framework 介绍
  15. Luogu1967 NOIP2013 货车运输 最大生成树、倍增
  16. Scala进阶之路-Spark底层通信小案例
  17. Mac系统常用快捷键
  18. js前端日期格式化处理
  19. python sys.argv[]的用法简明解释
  20. string 与 char 的区别

热门文章

  1. 数列分块入门九题(三):LOJ6283~6285
  2. Luogu P2059 [JLOI2013]卡牌游戏
  3. Codeforces Round #481 (Div. 3)
  4. STM32 M3内核的位带操作原理及步骤
  5. 老生常谈,函数柯里化(curring)
  6. NFS共享文件系统部署
  7. 第六周分析Linux内核创建一个新进程的过程
  8. LINUX内核分析第八周学习总结
  9. 同步手绘板——android端取色
  10. Fastdfs文件服务器搭建