Skip to content

What to do if WMI is Corrupt?

vScope uses Windows Management Instrumentation (WMI) to query information from Windows computers. Sometimes, issues may occur during WMI scans, resulting in partial or incomplete scans, flagged as PARTIAL_OK status. This indicates that the WMI probe in vScope couldn’t complete all queries successfully on the target machine.

This guide outlines methods to detect and resolve issues in the WMI repository on the target machine.

Steps to Detect WMI Repository Problems

Using WMI Diagnosis Utility

WMIDiag is a Microsoft tool that can be used to diagnose WMI issues. Download WMIDiag here.

  1. Download and decompress the tool on the target machine.
  2. Open a command prompt with administrator rights, navigate to the folder, and run:
cscript WMIDiag.vbs

The output logs are stored in %TEMP% and include details on WMI errors. The .TXT file typically contains an overview, while .LOG and .CSV files provide detailed results.

Using winmgmt Command

For Windows Vista and later versions, you can use:

winmgmt /verifyrepository

If the repository is consistent, you’ll see “WMI repository is consistent.” If it’s inconsistent, proceed to repair it.

Inspecting the WMI Repository Manually

The WMI repository is stored in %WINDIR%\System32\wbem\Repository. A typical repository should not exceed several hundred MBs. A very large repository may indicate corruption or other issues.

Fixing WMI Repository Problems

Repairing the Repository Using winmgmt

For inconsistent repositories, try salvaging or resetting the repository:

  • Salvage Repository
winmgmt /salvagerepository
  • Reset Repository
winmgmt /resetrepository

After this, you may need to reinstall any third-party applications that rely on WMI.

Rebuilding WMI MOF Files and DLLs

If issues persist, recompile all MOF files and re-register DLLs. Copy the commands below into a .BAT file and run it as an administrator:

Terminal window
@echo off
sc config winmgmt start= disabled
net stop winmgmt /y
cd %windir%\system32\wbem
for /f %%s in ('dir /b *.dll') do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in ('dir /s /b *.mof *.mfl') do mofcomp %%s

Restart the computer afterward.

Ensuring WMI Performance Data is Updated

Refreshing Performance Counters

Run wmiadapt in an elevated command prompt:

Terminal window
wmiadapt /f

Resyncing Performance Counters

To correct corrupted counters, use:

Terminal window
winmgmt /resyncperf

Reloading Performance Counters

To reload the counters:

Terminal window
lodctr /r

Additional Causes for Growing WMI Repository

A large or growing WMI repository might be due to RSOP logging, especially on environments with high login/logout activity like Citrix. To disable RSOP logging:

  • Windows 2003: Computer Configuration > Administrative Templates > System > Group Policy > Turn off Resultant Set of Policy logging
  • Windows 2008 and later: Computer Configuration > Policies > Administrative Templates > System > Group Policy > Turn off Resultant Set of Policy logging

Further Reading