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
Development resources, articles, tutorials, code samples, tools and downloads for ASP.Net, SQL Server, Reporting Services, T-SQL, Windows, AWS, SAP HANA and ABAP

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.


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.


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


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

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

goto End

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

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

SQL Server 2019 Installation
download SQL Server 2019
download SQL Server 2017
download SQL Server 2016
download SQL Server 2014
download SQL Server 2012
MacOS ve SQL Server 2019

Copyright © 2004 - 2021 Eralper YILMAZ. All rights reserved.