Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Config manager error: Cannot connect to WMI provider

Tags:

sql-server

I cant open my SQL server configuration manager getting this error message:

Cannot connect to WMI provider. You do not have permission or the server is unreachable. Note that you can only manage SQL Server 2005 and later servers with SQL Server Configuration Manager. 
Invalid

I have searched online material and ran the mofcomp command as recommended: mofcomp “C:\Program Files (x86)\Microsoft SQL Server\120\Shared\sqlmgmproviderxpsp2up.mof”

I am now getting this error message:

MOF file has been successfully parsed
Storing data in the repository…
An error occurred while processing item 10 defined on lines 73 – 79 in file C:\Program Files (x86)\Microsoft SQL Server\120\Shared\sqlmgmproviderxpsp2up.mof:
Compiler returned error 0x80070005Error Number: 0x80070005, Facility: Win32
Description: Access is denied.

Can you please help me out, been 2 weeks sited with this problem

like image 732
Immortal Avatar asked Jun 26 '17 05:06

Immortal


People also ask

What is SQL Server WMI provider?

The WMI Provider for Server Events lets you use the Windows Management Instrumentation (WMI) to monitor events in SQL Server. The provider works by turning SQL Server into a managed WMI object. Any event that can generate an event notification in SQL Server can be leveraged by the WMI by using this provider.

How do I open SQL Server Configuration Manager?

To open SQL Server Configuration Manager, in the Search charm, under Apps, type SQLServerManager<version>. msc such as SQLServerManager13. msc, and then press Enter.


Video Answer


3 Answers

Run Cmd as Administrator and execute these commands:

First go to SQL Shared folder according to your sql version:

SQL 2008: C:\Program Files (x86)\Microsoft SQL Server\100\Shared\
SQL 2012: C:\Program Files (x86)\Microsoft SQL Server\110\Shared\
SQL 2014: C:\Program Files (x86)\Microsoft SQL Server\120\Shared\
SQL 2017: C:\Program Files (x86)\Microsoft SQL Server\140\Shared\ -------> My version is 2017 SQL 2019: C:\Program Files (x86)\Microsoft SQL Server\150\Shared\

Find more versions here

cd "C:\Program Files (x86)\Microsoft SQL Server\140\Shared"

Then:

mofcomp sqlmgmproviderxpsp2up.mof

Update:

The problem occurs because the Windows Management Instrumentation (WMI) provider configuration file for manage SQL Server services is missing. So the mofcomp command repairs or recreates it.

Here is more explanation: https://learn.microsoft.com/en-us/windows/desktop/wmisdk/mofcomp

like image 98
Fereydoon Barikzehy Avatar answered Oct 16 '22 10:10

Fereydoon Barikzehy


Run the @Fereydoon Barkzehy codes with Administrative Access

Sample -

  cd C:\Program Files (x86)\Microsoft SQL Server\110\Shared
  cd C:\Program Files (x86)\Microsoft SQL Server\140\Shared
  mofcomp sqlmgmproviderxpsp2up.mof

depends on where the file "sqlmgmproviderxpsp2up.mof" is present

Youtube video

like image 21
Arun Prasad E S Avatar answered Oct 16 '22 11:10

Arun Prasad E S


The best solution for me was to uninstall the instance and reinstall a fresh instance. This worked 100%.

like image 38
Immortal Avatar answered Oct 16 '22 09:10

Immortal