如何修复 "WS-Management服务无法处理请求.存储库中的DMTF类使用与请求类不同的主要版本号.可以使用非DMTF资源URI访问此类.
没有.
This error typically occurs when there is a version mismatch or corruption in the Windows Management Instrumentation (WMI) repository or the Web Services-Management (WS-Management) configuration. It frequently triggers during remote management tasks (like WinRM or PowerShell Remoting) when the querying system requests a specific class version (often a newer DMTF standard) that does not match the schema version compiled inside the target machine's WMI repository.
逐步修复问题
按照以下方法来解决问题.
方法1:重新注册WMI组件和编译文件
通常情况下,类定义变得不映射.强迫Windows重新编译管理对象格式 (.mof) 文件解决了版本不匹配.
- 按下 Windows Key, 类型
cmd,右键点击 Command Prompt,并选择 Run as administrator. - 通过执行下列命令,一个接一个地停止 WinRM 和 WMI 服务:
net stop winrm net stop winmgmt - 导航到WMI目录:
cd %windir%\system32\wbem - 通过运行这个循环命令重新注册所有WMI. mof和. mfl文件:
for /f %s in ('dir /b *.mof *.mfl') do mofcomp %s - 重新注册WMI动态链接库:
for /f %s in ('dir /b *.dll') do regsvr32 /s %s - 重新启动您之前停止的服务:
net start winmgmt net start winrm
方法2:重建WMI存储库
如果重新注册文件不起作用,则存储库本身可能有结构性损坏,需要持续重建.
- 打开 Command Prompt 作为一个管理员.
- 通过运行: 检查WMI存储器的一致性
winmgmt /verifyrepository - 如果输出显示"存储库不一致",运行下面命令尝试实时维修:
winmgmt /salvagerepository - 如果错误仍然存在或保存失败,请完全重置存储器结构:
winmgmt /resetrepository - 重新启动您的计算机,以便Windows从零开始重建数据库.
方法3:更新或重新安装Windows管理框架 (WMF)
如果您在不同操作系统世代之间连接时遇到此错误 (例如,Windows 10/11与较旧的Windows服务器通信),则较旧的机器可能缺乏所需的DMTF类方案更新.
- 确定源机和目标机的操作系统版本.
- 确保两台机器都安装了最新的 Windows 更新,因为微软经常通过累积更新更新 WMI 方案.
- If you are using an older version of Windows Server, download and install the latest supported version of Windows Management Framework (WMF) 直接从微软官方的下载门户网站.
可能有一些错误.. Learn Microsoft