Solution
- To perform a repair/re-sync of the WMI repository, please do the following:
- Run the following commands in an administrative Command Prompt on the machine being monitored:
- For Windows XP and Windows 2000 Servers:
- winmgmt /clearadap
- winmgmt /kill
- winmgmt /unregserver
- winmgmt /regserver
- winmgmt /resyncperf
- For Windows 2003 Servers:
- wmiadap.exe /c
- wmiadap.exe /f
- lodctr /R
- For Windows 7 and Windows 2008 Servers:
- winmgmt /salvagerepository
- To perform a rebuild of the WMI repository, please do the following:
- Disable and stop the winmgmt service
- Remove or rename C:\Windows\System32\wbem\repository
- Enable and start the winmgmt service
- Open Command Prompt as Administrator
- Run the following commands:
- cd C:\Windows\System32\wbem\
- for /f %s in ('dir /b *.mof') do mofcomp %s
- NOTE: This will take a minute or so to complete.
- for /f %s in ('dir /b en-us\*.mfl') do mofcomp en-us\%s
- Open Performance Monitor to verify that all counters can be loaded
- NOTE: If PERFMON generates a popup error, please follow this Microsoft KB:
- To perform a repair/re-sync of the Windows 10 WMI repository, please do the following
1. Open an elevated command prompt.
2. Verify the WMI repository is not corrupt by running the following command:
winmgmt /verifyrepository
If the repository is not corrupted, a “WMI Repository is consistent” message will be returned. If you get something else, go to step 3. If the repository is consistent, you need to troubleshoot more granularly. The repository is not the problem.
3. Run the following commands to repair WMI:
winmgmt /salvagerepository
If the repository salvage fails to work, then run the following command to see if it resolves the issue:
winmgmt /resetrepository
After the last command, there should be a “WMI Repository has been reset” message returned that verifies the command was successful.