13

The folder C:\Windows\System32\wbem\ takes up almost 100 GB on my SSD drive. This doesn't feel like an optimal utilization of my SSD drive. Can it be reduced?

I've come across some references to "rebuilding your WMI repository" that seemed related to the wbem directory. So I've tried doing this, but the size did not decrease noticeably.

The content in the wbem directory is a lot of folders named repository.xxx where xxx is 001 to 096. These folders' sizes range from 758 MB to 1 140 MB. There is also a folder called merely repository, which is 1 078 MB in size.

I'm using Windows 8 Enterprise 64-bit (not Win 8.1). I just ran winmgmt /verifyrepository and got the result: WMI repository is consistent

Simeon
  • 133

2 Answers2

12

There should only be one copy of C:\Windows\System32\wbem\Repository.

The Repository.xxx folders might be WMI repository backups generated each time that you repair the repository or recreate it. It was once intended for the SCCM client agent to automatically try to rebuild the WMI repository if there was a consistency issue detected, a feature which might still exist and be the issue you are running into.

I do not know why you have so many of these folders, but it seems that WMI has an issue on your computer. As a first-aid, you could get rid of all these folders and rebuild the repository.

See also if the article Configuration Manager Client Health – Disable Automatic Remediation relates to your setup, as it contains a registry fix for a similar problem.

It also wouldn't hurt to run the sfc /scannow command.

The simplest WMI rebuild is done via :

  1. net stop winmgmt
  2. Move elsewhere all folders named C:\Windows\System32\wbem\Repository*
  3. net start winmgmt (should start rebuilding the repository)
  4. Wait a while and then reboot
  5. If everything works fine, you can junk the saved folders.

A WMI repair script that has been knocking around since ages (but I have never tried) might itself or in some parts-of still be useful on Windows 8 :

Echo Fix WMI
net stop winmgmt /y
if exist %windir%\system32\wbem\repository.001 rmdir /s /q %windir%\system32\wbem\repository.001
rename %windir%\system32\wbem\repository repository.001
%windir%\system32\wbem\winmgmt /clearadap
%windir%\system32\wbem\winmgmt /kill
%windir%\system32\wbem\winmgmt /unregserver
%windir%\system32\wbem\winmgmt /reserver
%windir%\system32\wbem\winmgmt /resyncperf
regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dll
mofcomp %windir%\system32\wbem\cimwin32.mof
mofcomp %windir%\system32\wbem\cimwin32.mfl
mofcomp %windir%\system32\wbem\rsop.mof
mofcomp %windir%\system32\wbem\rsop.mfl
cd \windows\system32\wbem
for /f %%s in ('dir /b /s %windir%\system32\wbem\*.dll') do regsvr32 /s %%s
for /f %%s in ('dir /b /s %windir%\system32\wbem\*.mof') do mofcomp %%s
for /f %%s in ('dir /b %windir%\system32\wbem\*.mfl') do mofcomp %%s
net start winmgmt
%windir%\system32\wbem\wmiprvse /regserver
%windir%\system32\wbem\winmgmt /regserver

After all this, you might reboot and run once more winmgmt /verifyrepository.

Be very careful with backups and create at least a system restore point before starting, or even better : take an image snapshot of the system disk.

harrymc
  • 498,455
-1

This was a known issue with the SCCM 2012 RTM release. The client was causing these issues. MS released an updated version and the issue went away. Afterwards, I was able to free up terabytes of data from the various servers.

Andrew
  • 1