Command line

Repair the WMI repository the careful way

The winmgmt commands to check and repair a WMI repository in the safe order, and why /resetrepository is the last resort.

LanguageBatch
What it does to the systemMakes changes. Test it on one computer first.

A broken WMI repository stops the SCCM client. Inventory, policy and installs all depend on WMI.

Check first, then use the mildest repair that works. Most computers never need the full reset.

Batch
rem 1. Check the repository. This only reads.
winmgmt /verifyrepository

rem 2. If step 1 says the repository is not consistent, salvage it.
rem    Salvage rebuilds the repository and keeps the data it can still read.
winmgmt /salvagerepository

rem 3. Check again. Run it twice if the first answer is still "not consistent".
winmgmt /verifyrepository

rem 4. LAST RESORT. Read the notes below first.
rem    This resets the repository to the state of a fresh Windows install.
rem    Remove the "rem" from the next line only if steps 1 to 3 have failed.
rem winmgmt /resetrepository

How to use it

  1. Open a Command Prompt as administrator on the computer.
  2. Run step 1. If it says "WMI repository is consistent", stop. WMI is not your problem.
  3. If it says the repository is not consistent, run step 2, then step 3.
  4. Restart the computer. Then check C:\Windows\CCM\Logs\ClientIDManagerStartup.log and PolicyAgent.log for new activity.
  5. If the SCCM client still fails, reinstall the client with ccmsetup.exe.

Good to know

  • Warning: /resetrepository deletes every WMI class that software added after Windows setup. That includes the SCCM client classes. Applications that depend on WMI can break.
  • After a reset, plan to reinstall the SCCM client. Other software may need a repair install too.
  • Do not reset the repository on a server until you know what its server roles and applications store in WMI.
WMI winmgmt verifyrepository salvagerepository client health
✉

Get new articles in your inbox

SCCM guides, AI tools, automation tips — sent when published. No spam.