SCCM Client FIX, WMI Repository corruption

The WMI Repository is the data database “%windir%\system32\wbem\repository” That stores meta-information and definitions for WMI Classes. In some cases the repository also stores static class data as well. If the Repository becomes corrupted, then the WMI service will not be able to function correctly. SCCM is build to use the WMI repository to work.

If you suspect that the WMI repository is corrupted the last thing you should do is rebuilding and deleting the repository, †it could damage your windows installation and let fail applications. Other steps need to be taken first to confirm that the repository is truly corrupted. A large repository could cause problems and†sometimes be interpreted as a corrupt repository, which is not always the case. If issues are due to a large repository, rebuilding the repository is currently the only method available to reduce the repository size.
Before you take anysteps make sure you used WMIdiag†to report any problems with the repository.
If repository is found to be inconsistent:
††† a. For Vista and newer, run from elevated command prompt:
Winmgmt /salvagerepository
Note†this command will take the content of the inconsistent repository and merge it into the rebuilt repository if it is readable
If the above doesnít work, then run:
Winmgmt /resetrepository
Note†this will reset repository to the initial state when the OS was first installed.
Note†In Windows XP and Windows Server 2003 there is no posibility to use switches for repairing the†repository.
Warning: Rebuilding the WMI repository has resulted in some 3rd party products not working until their setup is re-run & their MOF re-added back to the repository.
If /salvagerepository or /resetrepository does not resolve the issue, then manually rebuild repository:
  1. Open a CMD prompt with elevated privileges
  2. Use “net stop winmgmt” to stop the WMI services
  3. Rename the repository folder:† C:\WINDOWS\system32\wbem\Repository to Repository.old
  4. CD windows\system32\wbem
  5. for /f %s in (‘dir /b /s *.dll’) do regsvr32 /s %s
  6. Use “net start winmgmt” to start the WMI services
  7. cd /d c:\† ((go to the root of the c drive, this is important))
  8. for /f %s in (‘dir /s /b *.mof *.mfl’) do mofcomp %s
  9. Reboot the server or client