Friday, December 5, 2008

WMI, SCOM and Windows 2003 server

On many W2K03 servers WMI can get hosed when the SCOM Agent is installed. This is not due to the SCOM Agent but due to the fact that WMI on W2K03 servers is a bit instable.

Since the SCOM Agent utilizes WMI to its fullest extend, the less stronger parts of WMI will be giving problems. There are ways to 'reset' WMI but there is also a hotfix for it. Look here for this hotfix.

Always read the KB article completely so one knows whether this hotfix applies to their situation as well.
However, when one wants to reregister the WMI repository on a W2K03 server this script will do the trick:

net stop winmgmt
c:
cd %windir%\system32\wbem\
for %i in (*.dll) do RegSvr32 /s %i
for %i in (*.mof, *.mfl) do Mofcomp %i
net start winmgmt


Be careful running this script on productionservers since it can cause high cpu-cycles for some time. Be also sure when to run it since it dives deep into the WMI repository of the server.
Another method is to 'reset' WMI. This script can be used for it:

net stop winmgmt
c:
cd %windir%\system32\wbem\
rmdir /s /q Repository
rmdir /s /q Logs
mkdir Logs
net start winmgmt


Eventhough this script has most of the times a low impact on a productionserver, be careful to run it as well.
Thanks go out to multiple other webpages which supplied the above mentioned scripts. I have run these on some occasions and found them to be the solution to many WMI related errors.

No comments: