Managed Object Format (MOF) files define the Windows Management Instrumentation (WMI) classes stored in the WMI repository. If the repository becomes corrupted or the WMI class definitions are damaged, WMI queries may fail or return incomplete data, resulting in monitoring failures.
This article explains how to repair or rebuild the WMI repository on the target Windows server.
Note: Rebuilding the WMI repository should be performed only if repairing the repository does not resolve the issue.Disable and stop the Windows Management Instrumentation service.
Create a backup of the following directory:
C:\%windir%\System32\wbem\Repository
cd C:\%windir%\System32\wbem
for /f %s in ('dir /b /s *.dll') do regsvr32 /s %s
for /f %s in ('dir /b /s *.mof') do mofcomp %s
for /f %s in ('dir /b /s *.mfl') do mofcomp %s
Enable and start the Windows Management Instrumentation service.
Note: If required, replace %windir% with the appropriate Windows installation directory for your operating system.| Operating System | Windows Directory |
|---|---|
| Windows 2000 | winnt |
| Windows XP, Windows Server 2003, Windows Server 2008 | windows |
| Other Windows versions | Windows |
winmgmt /verifyrepository
If the following message is displayed:
WMI Repository is consistent
the repository is healthy, and the issue is likely caused by another WMI component.
If any other message is returned, continue with the repair steps below.
Run the following command:
winmgmt /salvagerepository
If the repair is successful, verify whether the monitoring issue has been resolved.
If the previous command does not resolve the issue:
winmgmt /resetrepositoryIf the reset is successful, the following message is displayed:
WMI Repository has been reset
Execute the following commands:
wmiadap /f
lodctr /R
Execute the following commands:
winmgmt /clearadap
winmgmt /kill
winmgmt /regserver
winmgmt /resyncperf
After repairing or rebuilding the repository:
For additional information, refer to the following Microsoft article: