如何修复 "WINRM证书映射配置存储达到内部限制,无法创建更多条目.删除一些条目并再次尝试. "
The Error occurs when the Windows Remote Management (WinRM) configuration store exceeds its maximum capacity for certificate-to-user mappings. This typically happens in environments that rely heavily on Certificate-Based Authentication for WinRM, where old, unused, or duplicate mappings accumulate over time without being purged.
当达到这个极限时,WinRM阻止创建新的客户端证书映射,防止新用户或服务建立远程连接.
一步一步的修复
要解决这个问题,您必须使用命令提示符或PowerShell清除过时或重复的证书映射.
步骤1: 作为管理员打开命令提示符
- 按下 Windows Key 在你的键盘上.
- 它们的类型 cmd 在搜索中.
- 按右键按一下 Command Prompt 在搜索结果中.
- 选择 Run as administrator.
步骤2:查看现有的WinRM证书映射
在删除条目之前,列出所有当前映射,以确定哪些是过时或冗余的.运行以下命令:
winrm enumerate winrm/config/service/certmapping
This command displays a list of all active certificate mappings, including their Issuer, Subject, URI,以及 UserName.
步骤3:删除未使用或重复的映射
为了在内部配置存储中释放空间,通过针对其唯一标识符删除特定条目 ( Subject, Issuer,以及 URI 执行删除命令使用以下结构:
winrm delete winrm/config/service/certmapping?Issuer=ISSUER_THUMBPRINT+Subject=SUBJECT_NAME+URI=TARGET_URI
取代 ISSUER_THUMBPRINT, SUBJECT_NAME,以及 TARGET_URI 在步骤2中的列表中返回的确切值.
步骤4:增加配置存储限制 (可选)
如果您的环境需要大量的并发映射,您可以增加 MaxEnvelopeSizeKB 设置,以便为 WinRM 提供更多的配置数据运行内存.运行此命令:
winrm set winrm/config @{MaxEnvelopeSizeKB="8192"}
步骤 5: 重新启动 WinRM 服务
通过重新启动 Windows 远程管理服务,应用所有更改. 按顺序运行以下两个命令:
net stop winrm
net start winrm
预防最佳实践
- Automate Cleanup: 通过任务调度器实现一个PowerShell脚本,以自动删除过期的证书映射.
- Use Group Policies: 使用 Active Directory 集团策略对象来全球管理 WinRM 访问,而不是依赖于单个本地证书映射.
可能有一些错误.. Learn Microsoft