SQL Server administration and T-SQL development, Web Programming with ASP.NET, HTML5 and Javascript, Windows Phone 8 app development, SAP Smartforms and ABAP Programming, Windows 7, Visual Studio and MS Office software SQL Server and T-SQL Development Tutorials
Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Windows, Windows Phone, SAP and ABAP, like SAP UI5, Screen Personas, etc.




download SQL Server 2017
download SQL Server 2016
download SQL Server 2014



SQL Server 2008 Setup : Windows Management Instrumentation (WMI) service failed.


I install SQL Server 2008 R2 on my new computer at work. Actually I had some difficulties while installing SQL Server 2008 R2 due to Windows Management Instrumentation (WMI) service failure.

When SQL Server 2008 setup started, first the Setup Support Rules runs and checks if there is any problem that will affect Microsoft SQL Server 2008 R2 instance on the computer.
Here is the first check results on my computer.

sql-server-2008-r2-setup-wmi-service-failed

Rule Check Result
Rule "Windows Management Instrumentation (WMI) service failed.

The Windows Management Instrumentation (WMI) service cannot be started. To continue with the installation, you must troubleshoot and repair your Windows Management Instrumentation (WMI) service.

windows-management-instrumentation-wmi-service-cannot-be-started





When I search a little on the web about this topic, I found a discussion on MSDN at thread titled "SQL Express 2008 Installation error" at this URL. Actually this seems to be the same error with my case where I try to install SQL Server 2008 R2.

It is stated that although WMI service is corrupt, it might appear to be running when checked using the Services Management Console.
This is strange since when I open the Services Management Console the WMI service is displayed with Started status.
One of the methods you can use to determine whether the WMI service is running or not is checking the "Dependencies" tab of the WMI service properties screen.
Right click on the WMI service in the management console. Right click on the service name and choose Properties from the context menu.
Activate the "Dependencies" tab. If you are displayed an error such as "WMI: Initialization Failure" then you can be sure that the WMI service is not up and actually running.

I got the following error on Service Dependencies tab of the WMI service (Windows Management Instrumentation).

WMI: Initialization failure

service-dependencies-wmi-initialization-failure

One of the participants named Angrydavie offered to reinstall WMI service.
He has also given the script to reinstall WMI service which re-register WMI.
Please note that it is your own risk if the script corrupts Windows folders.

@echo on
cd /d c:\temp
if not exist %windir%\system32\wbem goto TryInstall
cd /d %windir%\system32\wbem
net stop winmgmt
winmgmt /kill
if exist Rep_bak rd Rep_bak /s /q
rename Repository Rep_bak
for %%i in (*.dll) do RegSvr32 -s %%i
for %%i in (*.exe) do call :FixSrv %%i
for %%i in (*.mof,*.mfl) do Mofcomp %%i
net start winmgmt
goto End

:FixSrv
if /I (%1) == (wbemcntl.exe) goto SkipSrv
if /I (%1) == (wbemtest.exe) goto SkipSrv
if /I (%1) == (mofcomp.exe) goto SkipSrv
%1 /RegServer

:SkipSrv
goto End

:TryInstall
if not exist wmicore.exe goto End
wmicore /s
net start winmgmt
:End

Open NotePad and copy the above script code.
Save the WMI script text file as "reinstall-wmi.bat"
Double click the .bat batch file to execute the script.

After running the above script, I restarted my computer.
After reboot, the SQL Server Setup Support was successfully worked.

sql-server-2008-r2-setup-support-rules-passed






Related SQL Resources

SQL Server Articles

SQL Server 2012

SQL Server Tools

SQL Blog

MS SQL Server Forums









Copyright © 2004 - 2017 Eralper YILMAZ. All rights reserved.
Community Server by Telligent Systems