如何修复 "WS-Management客户端无法处理请求.订阅器没有连接到一个域. "
没有.
This error occurs when you attempt to configure or use WS-Management (Web Services-Management / WinRM) for remote management, event forwarding, or subscription handling on a machine that operates within a Workgroup rather than an Active Directory Domain. By default, Windows enforcement policies restrict certain WS-Management and event subscription operations to domain environments for mutual authentication and security purposes. When the local machine (the subscriber) is not part of a domain, the WinRM client blocks the handshake, resulting in the error message: "WS-Management客户端无法处理请求.订户机器没有连接到一个域. "
一步一步的修复
To resolve this issue, you must configure the Windows Remote Management (WinRM) service to accept non-domain connections by adding the target computers to the TrustedHosts 在出现错误的机器上执行以下步骤:
步骤1: 打开PowerShell作为管理员
- 按下 Start 菜单是这样的.
- 它们的类型 PowerShell 在搜索中.
- 按右键按一下 Windows PowerShell 从结果中选择. Run as administrator.
步骤2:启用和配置 WinRM 服务
- 在PowerShell窗口中,键入以下命令以确保WinRM服务运行并配置自动启动:
Enable-PSRemoting -Force - 按下 Enter 如果提示要进行更改,输入
Y然后按下. Enter.
步骤3:将目的地主机添加到可靠主机列表中
由于机器不在一个域中,您必须明确告诉Windows信任您连接的远程计算机.
- 相信自己. all 计算机 (建议用于测试或安全私人网络),执行:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force - 另一个选择是,如果您希望仅信任特定计算机,以提高安全性,则用逗号分隔的IP地址或主机名称列表替换星号:
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "192.168.1.50, RemotePCName" -Force - 重新启动 WinRM 服务以应用新配置更改:
Restart-Service WinRM
步骤4:配置本地帐户令牌过策略 (如果使用本地管理员帐户)
如果您使用本地管理员帐户而不是域名帐户进行连接,Windows用户帐户控制 (UAC) 可能仍然会阻止连接.您需要修改注册表以允许远程管理操作.
- 在您的 PowerShell 管理窗口中运行下列命令,创建必要的注册表密钥:
New-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "LocalAccountTokenFilterPolicy" -Value 1 -PropertyType DWord -Force
步骤5:验证配置
- 检查你的
TrustedHosts设置是通过运行正确的:Get-Item WSMan:\localhost\Client\TrustedHosts - 通过重新运行原始命令或事件订阅任务,验证配置是否解决了您的问题.
可能有一些错误.. Learn Microsoft