Immortal
Immortal

Reputation: 1190

SQL Server Config manager error: Cannot connect to WMI provider

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

Upvotes: 58

Views: 110062

Answers (8)

kasuntec
kasuntec

Reputation: 25

  1. Go to MSSql installation folder (C:\Program Files (x86)\Microsoft SQL Server\160)
  2. go to Shared folder and cmd with admin rights
  3. run "mofcomp sqlmgmprovider.mof" (make sure sqlmgmprovider.mof file is exists in the folder)
  4. Done. Now you can open the SQL Server Config manager as normally.

Upvotes: 1

user7918666
user7918666

Reputation:

doing a fresh OS installation also worked for me as well. but this is a pain. Sometimes you can run the:

“C:\Program Files (x86)\Microsoft SQL Server\120\Shared\sqlmgmproviderxpsp2up.mof”

Sometimes it helps and sometimes it doesn't, all you need to do is do a fresh OS installation and then SQL installation.

Upvotes: 1

UnDiUdin
UnDiUdin

Reputation: 15394

By trial and error I finally found this working solution:

  1. I searched all sqlmgmproviderxpsp2up.mof files under C:\Program Files (x86)\Microsoft SQL Server

  2. Running CMD as administrator I did for each result found above:

    i) Change directory to go to the directory

    ii) Run mofcomp sqlmgmproviderxpsp2up.mof

  3. Reboot

Then, it works.

Upvotes: 1

fbarikzehy
fbarikzehy

Reputation: 5425

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

Upvotes: 154

Willy David Jr
Willy David Jr

Reputation: 9151

I have the same issue but it is not working at first. Second I already restarted my PC but it is not working either. What I found out is that you will run this on the folder where your SQL Server Management Studio is installed and not on the MS SQL Instance folder.

My SQL Server Management Studio which is 2016 is installed in

C:\Program Files (x86)\Microsoft SQL Server\130

But I keep on running changing folder on which I installed on my SQL Server 2012 instance:

C:\Program Files (x86)\Microsoft SQL Server\110\Shared\

After that, just run the command: mofcomp sqlmgmproviderxpsp2up.mof as everyone suggest in here.

So keep it mind the folder since that may affect your troubleshooting.

Upvotes: 1

Nitish Bannur
Nitish Bannur

Reputation: 11

What worked for me was to download the SQLEXPR_x64_Enu, run the Setup.exe and use the Repair option.

Upvotes: 0

Immortal
Immortal

Reputation: 1190

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

Upvotes: 3

Arun Prasad E S
Arun Prasad E S

Reputation: 10135

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

Upvotes: 12

Related Questions