SQL Server Config manager error: Cannot connect to WMI provider

40

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

sql-server
asked on Stack Overflow Jun 26, 2017 by Immortal

7 Answers

80

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://docs.microsoft.com/en-us/windows/desktop/wmisdk/mofcomp

answered on Stack Overflow Aug 4, 2018 by Fereydoon Barikzehy • edited May 27, 2021 by LuizLoyola
5

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

answered on Stack Overflow Mar 16, 2019 by Arun Prasad E S • edited Mar 18, 2019 by Arun Prasad E S
1

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

answered on Stack Overflow Jul 3, 2017 by Immortal • edited Mar 18, 2019 by Arun Prasad E S
0

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 help, all you need to do is doing a fresh OS installation and then SQL installation.

answered on Stack Overflow Jul 6, 2017 by (unknown user) • edited Mar 18, 2019 by Arun Prasad E S
0

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

answered on Stack Overflow Oct 7, 2019 by LaBracca
0

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

answered on Stack Overflow Apr 16, 2020 by Nitish Bannur
0

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.

answered on Stack Overflow Aug 16, 2020 by Willy David Jr

User contributions licensed under CC BY-SA 3.0