WMI causes Hour Delays!

Server 2008 R2 stuck at "Applying Computer Settings" for over 2 hours. It then took another 4.5 hours to log in. Using Process Explorer, I discovered that it was the WMI service that had the CPU pegged and RAM just being chipped away. Killed the service, ran the script below, and we had server reboots in under 2 mins and logins less than 30 seconds.

@echo off REM Change startup type to Window Management Instrumentation (WMI) Service to disabled REM Stop the WMI Service; you may need to stop IP Helper Service first or other dependent services before it allows you to stop WMI Service REM Rename the repository folder: C:\WINDOWS\system32\wbem\Repository to Repository.old REM Open a CMD Prompt with elevated privileges sc config winmgmt start= disabled net stop winmgmt /y ECHO RENAME this folder to .old -^> %windir%\System32\Wbem\Repository pause %systemdrive% cd /d %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

Screen Shot: Notice the HUGE DATA file (1.9 GB)

2016-05-19 10_47_39-Work - Win 7 [Running] - Oracle VM VirtualBox

Screen Shot: Notice the much more palatible DATA file (42 MB)

2016-05-19 10_47_55-Work - Win 7 [Running] - Oracle VM VirtualBox