- Most Recent Articles on MrTweak.com
- Free Trial of Exchange Server 2007, Hosted by Microsoft and Unisys
- Stop Expiration of HP Inkjet Printer Cartridges
- Dugg or Slashdotted: Why Shared Web Hosting is a Scam
- MrTweak.com Server Transfer - Excuse Any Downtime
Posted Windows Servers, Windows Scripting, Exchange Server on Saturday, September 24th, 2005.
The WMI repository on one of our Exchange 2003 servers recently became corrupted, interrupted outgoing mail handling, and flooded the event logs. After some research I found the corruption isn’t entirely uncommon on Windows Server 2003 or even Windows XP systems. It is indicated by event ID’s 40, 42, 47, 63 from the WinMgmt process, event ID 3006 from the LoadPerf process, and event ID 9098 from the ExchangeSA and MAD monitoring processes. Trying to track a message in the Exchange message tracking center also displayed error code 8004100e.
I confirmed it was a WMI error by running WBEMTEST (just type “wbemtest” into the run dialog). Then click “Connect…” and try to connect to “root\microsoftexchangev2″. Should connecting to that path fail, try to connect to “root\cimv2″. If that works then WMI needs to be cleared and reregistered on the server. The script below is configured to close the Windows Management process, clear the repository, reinstall WMI, and restart the process - which should fix the errors on Windows Server or XP without a reboot. (Thanks to Luke Edson for the basis of this script. The script makes heavy use of the mofcomp compiler, see Microsoft’s description of mofcomp utility.)
WMI Repair Script (run as .BAT file):
net stop winmgmt
c:
cd %windir%\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 -n:root\cimv2\applications\exchange wbemcons.mof
mofcomp -n:root\cimv2\applications\exchange smtpcons.mof
mofcomp exmgmt.mof
mofcomp exwmi.mof
net start winmgmt
3 Responses to “Exchange WMI Errors - WMI Repository Clear & Reinstall Script”
Comment on this post below
You can leave a response, or trackback from your own site.
Fantastic! Worked great and solved my problem. Thank you so much!
Thanks Brian - hopefully it helped you shave some time off what could have been a long day of scripting or phone support.
I keep getting an error with shaderapidx9.dll, and I’ve tried this script and the problem still persists, any help would be greatly appreciated.