WMI: Repository Corruption
Scenario:
Windows Management Instrumentation is failing due to the repository being corrupted.
The WMI Repository (%windir%System32WbemRepository) is the database that stores meta-information and definitions for WMI classes; in some cases, the repository also stores static class data. If the Repository becomes corrupted, then the WMI service will not be able to function correctly.
Issue:
If WMI is corrupted, you can receive various errors and symptoms, depending on what activity is being done. Below is one of the most common errors and symptoms that could indicate that the repository is corrupted when a user is trying to launch RIL/Retail Pro 9:
When running RIL/Retail Pro 9 the following error will appear:
" Initialization failed or Retail Pro is unable to communicate with the database. Please ensure your database has been started or contact your technical support for additional assistance."
After confirming all services are running and database is in open state, the first thing to check is the state of WMI. If it is corrupted, then it should match the following screenshot:
- Failed to initialize all required WMI classes.
- win32_Processor: WMI: Invalid classes
- win32_WMISetting: WMI: Invalid class
- security info: Successful
- win32_operatingsystem: WMI: invalid class
Question 1: Where to check WMI?
Right-click on Start Menu > Computer Management > Services and Applications > WMI Control > Right-click> Properties.
Question 2: How to reset the WMI Repository?
Courtesy of https://www.thewindowsclub.com/how-to-repair-or-rebuild-the-wmi-repository-on-windows-10
Open Command Prompt with elevated privileges.
- Start > Type CMD > Right click > Run as administrator > Run the following commands as shown in the screenshot:
Here are the commands that you should run step by step:
-
> sc config winmgmt start= disabled
-
> net stop winmgmt
-
Do you want to continue this operation? (Y/N) [N]: y
-
> Winmgmt /salvagerepository %windir%\System32\wbem
-
> Winmgmt /resetrepository %windir%\System32\wbem
-
> sc config winmgmt start= auto
Now it is recommended to reboot the operating system.
Conclusion:
After rebooting, the ideal look of WMI should be as follow:
Right-click on Start Menu > Computer Management > Services and Applications > WMI Control > Right-click> Properties.
At this point, users should be able to launch and log into RIL/V9 without any issues/errors.
Advisory Note:
If you run into a repeated corruption issue in your environment with WMI, try to exclude the WBEM folder and all subfolders under it from AV scanning. AV scanning is known to cause corruption and other issues in WMI.
Here is the path of WBEM [C:\Windows\System32\wbem].
RPI highly recommends disabling Firewall/AV/UAC and setting DEP to essential Windows programs and services only.