meyay
(Metin Y.)
July 5, 2022, 5:39am
8
Thank you for the follow up! Your response made check the docs regarding the parameters used in the fix:
https://docs.microsoft.com/en-us/windows/win32/wmisdk/winmgmt:
/verifyrepository
Performs a consistency check on the WMI repository. When you add the /verifyrepository switch without the argument, then the live repository currently used by WMI is verified. When you specify the path argument, you can verify any saved copy of the repository. In this case, the path argument should contain the full path to the saved repository copy. The saved repository should be a copy of the entire repository folder. For more information about errors returned by this command, see the Remarks section.
/salvagerepository
Performs a consistency check on the WMI repository, and if an inconsistency is detected, rebuilds the repository. The content of the inconsistent repository is merged into the rebuilt repository, if it can be read. The salvage operation always works with the repository that the WMI service is currently using. For more information about errors returned by this command, see the Remarks section.
% MOF files that contain the #pragma autorecover preprocessor statement are restored to the repository.
/resetrepository
The repository is reset to the initial state when the operating system is first installed. MOF files that contain the #pragma autorecover preprocessor statement are restored to the repository.
Since it feels that /resetrespository might result in state loss, I googled further and stumbled accross the blog post WMI: Repository Corruption, or Not? from one of the Microsoft engineers.
It provides plenty of background informations and seems like a cautios way to detect and fix the WMI inconsistency issue.
I feel this is the relevant part for Win10/Win11 users:
If the repository check ( winmgmt /verifyrepository) comes back as inconsistent, your first action is to run “ winmmgmt /salvagerepository” followed by running “ winmgmt /verifyrepository” again to see if it now comes back as consistent.
If it is still comes back inconsistent, then you need to run “ winmgmt /resetrepository .”
One sentence realy caught my eye on the blog post:
As a final note, if you run into a reoccurring 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.
1 Like