【发布时间】:2018-04-25 16:43:45
【问题描述】:
machineName 已尝试通过以下方式使用 invoke-command 执行脚本:
Invoke-command -filepath C:\scripts\GettMembers.ps1 -computername "machinename" -credential $Getcredential
但我收到以下错误:
Connecting to remote server failed with the following error message : The WinRM client cannot process the request because the server name cannot be resolved. For more information, see the about_Remote_Troubleshooting Help topic.
但我可以使用以下命令将机器添加到本地机器的受信任主机:
winrm set winrm/config/client `@{TrustedHosts="machineName"}'
【问题讨论】:
-
所以大概你的命令实际上看起来像这样:
Invoke-Command -computername madhsubr-lap.idc.oracle.com ...?也就是说,您并没有真正使用“机器名”,对吗? :-) 您是否在 madhsubr-lap.idc.oracle.com 上尝试过 nslookup? -
似乎是名称解析 (DNS) 错误。试试
nslookup <remotecomputer> -
这是一个错误。我使用的是机器名本身,即invoke-command和winrm set命令中使用的机器名是相同的。我尝试在机器上运行 nslook。我收到以下异常:'找不到 machineName: Non-existent domain'
标签: powershell powershell-2.0 invoke powershell-remoting