Rebuild WMI

WMI is the database 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.
In such time we need to rebuild repository .

Notr: Deleting and rebuilding the repository can cause damage to the system or to installed applications. Other steps should be taken first to eliminate other possibilities or to confirm we have repository corruption.

Location of he file
%windir%System32\Wbem\Repository

Errors
Unable to connect to root\default or root\cimv2 namespaces thru wbemtest. Fails returning error code 0x80041002 pointing to WBEM_E_NOT_FOUND
When we open Computer Management and Right Click on Computer Management(Local) and select Properties, you get the following error: “WMI: Not Found” or it hangs trying connect
0x80041010 WBEM_E_INVALID_CLASS
Trying to use wbemtest, it hangs

Re-register all of the dlls and recompile the .mofs in the wbem folder and re-registering WMI Service and Provider.

@echo off
sc config winmgmt start= disabled
net stop winmgmt /y
%systemdrive%
cd %windir%\system32\wbem
for /f %%s in (‘dir /b *.dll’) do regsvr32 /s %%s
wmiprvse /regserver
winmgmt /regserver
sc config winmgmt start= auto
net start winmgmt
for /f %%s in (‘dir /s /b *.mof *.mfl’) do mofcomp %%s

Ans reboot the machine and test WMI

How to varify
winmgmt /verifyrepository

Advertisements

Posted on December 23, 2013, in Uncategorized, Windows. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: