Friday, October 20, 2006

Rebuilding the WMI repository

A while back I had to rebuild a corrupt WMI repository. After researching the issue for a couple of days I came across a solution that worked. Props to Todd J Heron, MCSE for coming up with a solution to rebuild the repository. I looked for the link to the original post but couldn’t find it. So I will post it in the hopes that someone having the same problem can find it. If you have the original link please post it in the comments.


-----------------------------------------------------------------------------------------

net stop winmgmt
pause
c:
cd c:\windows\system32\wbem
rd /S /Q repository
regsvr32 /s %systemroot%\system32\scecli.dll
regsvr32 /s %systemroot%\system32\userenv.dll
mofcomp cimwin32.mof
mofcomp cimwin32.mfl
mofcomp rsop.mof
mofcomp rsop.mfl
for /f %%s in ('dir /b /s *.dll') do regsvr32 /s %%s
for /f %%s in ('dir /b *.mof') do mofcomp %%s

for /f %%s in ('dir /b *.mfl') do mofcomp %%s
mofcomp exwmi.mof
mofcomp -n:root\cimv2\applications\exchange wbemcons.mof
mofcomp -n:root\cimv2\applications\exchange smtpcons.mof
mofcomp exmgmt.mof

Just cut and paste the above code and save it as a script.

Links
More WMI Information
WMI Diagnosis Utils

No comments: