如何修复 "WinRM客户端无法处理请求.如果客户端计算机没有连接到一个域,则无法使用隐式身份验证.
没有.
当您尝试使用Windows远程管理 (WinRM) 连接到使用Kerberos身份验证的远程计算机时,此错误会发生,但您的本地计算机在一个工作组中运行,而不是连接到一个Active Directory域. Kerberos严格要求一个集中域基础设施来验证凭证. 当您不明确提供用户凭证 (隐式凭证) 时,WinRM默认为Kerberos,并期望您的本地机器身份是该域的一部分,在工作组环境中失败.
逐步修复问题
为了解决这个问题,您必须配置 WinRM 以使用 NTLM 认证来信任远程主机,或者在连接期间明确提供凭证.
方法1:将远程主机添加到可靠主机列表中
Since Kerberos cannot be used, you must tell your local computer to trust the remote machine using NTLM authentication.
- 在你的 local computer 点击开始菜单,输入 PowerShell,右键点击它,并选择 Run as administrator.
- 运行下一个命令来检查您当前的TrustedHosts配置:
Get-Item WSMan:\localhost\Client\TrustedHosts - Run the following command to allow your computer to connect to the specific remote IP address or hostname (replace
REMOTE_COMPUTER_IP_OR_NAME您的实际远程机器的详细信息):Set-Item WSMan:\localhost\Client\TrustedHosts -Value "REMOTE_COMPUTER_IP_OR_NAME" -Force注意:如果您想连接到任何计算机 (不安全,只推用于私人网络),您可以使用字符号符号 现在我们要做些什么?
- 通过运行重新启动 WinRM 服务来应用更改:
Restart-Service WinRM
方法2:传递明确凭证并定义身份验证类型
在执行 WinRM 或 PowerShell 移除命令时,您必须明确提供用户名和密码,而不是依赖隐式凭证,并指定身份验证机制.
If you are using PowerShell Remoting (Enter-PSSession or Invoke-Command):
- 打开PowerShell
- 使用
-Credential参数旁边的-Authentication参数设置为Negotiate或是Basic. - 运行这样的连接命令:
Enter-PSSession -ComputerName REMOTE_COMPUTER_IP_OR_NAME -Credential (Get-Credential) -Authentication Negotiate - A pop-up window will appear. Enter the username and password of an administrator account that exists on the remote 电脑.
方法 3: 检查两台计算机的 WinRM 认证设置
确保 WinRM 客户端和服务器配置允许 NTLM (谈判) 认证.
- 打开 PowerShell as an administrator 在本地和远程计算机上.
- 运行下列命令来查看已启用的身份验证类型:
Get-ChildItem WSMan:\localhost\Service\Auth Get-ChildItem WSMan:\localhost\Client\Auth - 确保这一点.
Negotiate这里是我的家.Basic(如果需要) 设置为True如果Negotiate已设置为False通过运行:Set-Item WSMan:\localhost\Client\Auth\Negotiate -Value $true Set-Item WSMan:\localhost\Service\Auth\Negotiate -Value $true
可能有一些错误.. Learn Microsoft