Today I had a problem on a server running Windows Server 2008, the WMI repository on the server got inconsistent and I had to rebuild it
As it is written on wikipedia:
http://en.wikipedia.org/wiki/Windows_Management_Instrumentation - "Windows Management Instrumentation (WMI) is a set of extensions to the Windows Driver Model that provides an operating system interface through which instrumented components provide information and notification".
The location of the WMI Repository is "%windir%System32\Wbem\Repository" , you can check here the size and when the WMI Respository was created/modified:
Take good precaution when you are manipulating the WMI Repository because it can harm your system or the applications that are installed. Before you start working with it do a little diagnosis by running the application
WMI Diagnosis Utility, you can download it from Microsoft's website : http://www.microsoft.com/en-us/download/confirmation.aspx?id=7684. Check also event viewer for some WMI errors. After you know that there is a problem with the wmi repository try the following:
Open cmd with administrator credentials
Add the following in a .bat file (only the Bold lines):
@echo off
sc config winmgmt start= disabled
cd %windir%
This command will set the Winmgmt service to be disabled upon startup. Read more about Winmgmt here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394525(v=vs.85).aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394525(v=vs.85).aspx
net stop winmgmt /y
Stops the winmgmt servicecd %windir%
Changes directory to windows location
cd system32\wbem
cd system32\wbem
Changes directory to wbem folder
for /f %%s in ('dir /b *.dll') do regsvr32 /s %
for /f %%s in ('dir /b *.dll') do regsvr32 /s %
for all .dll files to a register
wmiprvse /regserver
wmiprvse /regserver
registers the wmiprvse service
winmgmt /regserver
winmgmt /regserver
registers the winmgmt service
sc config winmgmt start= auto
sc config winmgmt start= auto
This command will set the Winmgmt service to auto start upgon startup
net start winmgmt
net start winmgmt
Starts the winmgmt service
for /f %s in ('dir /s /b *.mof *.mfl') do mofcomp %s
for /f %s in ('dir /s /b *.mof *.mfl') do mofcomp %s
for all .mof and .mfl files recompile them using mofcomp command
shutdown /l /r
If this solution doesn't resolve the issue then try the following:
Winmgmt /verifyrepository
This command will check the repository status. If the status is inconsistent then type the following
Winmgmt /salvagerepository
This command will try to salvage the repository by merging the content of the repository into a rebuild repository if it's possible
Winmgmt /verifyrepository
If the status is consistent then your job is done if the status is still inconsistent
Winmgmt /resetrepository
This command will reset the repository and will reset it to defaults
This steps should fix the problem, I hope this post will help if you encounter the same problem.
For now have a nice day.
If this solution doesn't resolve the issue then try the following:
Winmgmt /verifyrepository
This command will check the repository status. If the status is inconsistent then type the following
Winmgmt /salvagerepository
This command will try to salvage the repository by merging the content of the repository into a rebuild repository if it's possible
Winmgmt /verifyrepository
If the status is consistent then your job is done if the status is still inconsistent
Winmgmt /resetrepository
This command will reset the repository and will reset it to defaults
This steps should fix the problem, I hope this post will help if you encounter the same problem.
For now have a nice day.







0 comments