WinRM不起作用 Connecting to remote server failed with the following error message : WinRM cannot complete the operation
当我运行下面的 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 重置下,就好了。
最新文章
- requirejs:研究笔记
- Android -- 常见控件的小效果
- centos 配置 ssl服务
- ActiveMQ第一弹:安装与运行
- [主席树]SPOJ DQUERY
- Magento 使用心得
- 第六篇:R语言数据可视化之数据分布图(直方图、密度曲线、箱线图、等高线、2D密度图)
- MVC跳转
- div和span的区别
- DLT(Diagnostic Log and Trace)嵌入式系统程序运行记录
- cocoapods的安装和使用以及版本升级遇到的问题
- Excel VBA TextBox控件的滚动条不能刷新
- 【转载】Centos系统快速部署LNMP环境
- 01 Django REST Framework 介绍
- Luogu1967 NOIP2013 货车运输 最大生成树、倍增
- Scala进阶之路-Spark底层通信小案例
- Mac系统常用快捷键
- js前端日期格式化处理
- python sys.argv[]的用法简明解释
- string 与 char 的区别