【发布时间】:2017-10-15 22:54:44
【问题描述】:
我可以在网络上的另一台机器上使用Invoke-Command。
我已经以管理员身份运行Enable-PSRemoting。
- PSVersion 5.0.10586.117
- Windows 7 专业版 SP1
我错过了什么?
PS C:\Windows\system32> winrm 快速配置 WinRM 服务已经在这台机器上运行。 WinRM 已设置为在此计算机上进行远程管理。 PS C:\Windows\system32> Invoke-Command -ComputerName localhost -ScriptBlock { dir } [localhost] 连接到远程服务器 localhost 失败,出现以下错误 message :客户端无法连接到请求中指定的目的地。 验证目标上的服务是否正在运行并且正在接受请求。 查阅在 WS-Management 服务上运行的日志和文档 目的地,最常见的是 IIS 或 WinRM。如果目标是 WinRM 服务, 在目标上运行以下命令以分析和配置 WinRM 服务:“winrm 快速配置”。有关详细信息,请参阅 about_Remote_Troubleshooting 帮助主题。 + CategoryInfo : OpenError: (localhost:String) [], PSRemotingTransportException + FullyQualifiedErrorId:无法连接,PSSessionStateBroken将DisableStrictNameChecking 设置为一 (1) 后,出现相同的错误消息。
将BackConnectionHostNames设置为“localhost”和“ALFRED”后,出现同样的错误信息。
将 DisableLoopbackCheck 设置为一 (1) 后,会出现以下消息。
PS C:\Windows\system32> winrm quickconfig
WinRM service is already running on this machine.
WSManFault
Message
ProviderFault
WSManFault
Message = WinRM firewall exception will not work since one of the network connection types on this ma
chine is set to Public. Change the network connection type to either Domain or Private and try again.
Error number: -2144108183 0x80338169
WinRM firewall exception will not work since one of the network connection
types on this machine is set to Public. Ch
ange the network connection type to either Domain or Private and try again.
我似乎没有更改网络类型的权限。我在企业 VPN 上。 company.com 网络是Domain network,但另一个网络是Public network。如果我不能改变它,那么我似乎无法从这里到达那里。
【问题讨论】:
标签: powershell powershell-remoting