SQL SERVER – Configuration Manager – Cannot Connect to WMI Provider. You Do Not Have Permission or The Server is Unreachable

A few months ago, I wrote a blog which tells us reasons about why we should use tools provided with the product rather than generic tools. Yeah, I am talking about services.msc vs. SQL Server Configuration manager.

Why to Use SQL Server Configuration Manager Over Services applet (services.msc)? – Interview Question of the Week #112

Once of the blog reader reported below error.

SQL Server Configuration Manager
—————————
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 class [0x80041010]

I contacted him via email provided and he also shared the image of the message.

SQL SERVER - Configuration Manager - Cannot Connect to WMI Provider. You Do Not Have Permission or The Server is Unreachable mof-comp-01

While searching on the internet, there were various blogs talking about below solution.

  1. Find the *.mof file for SQL Server 100 (SQL2008) or 110 (SQL2012) or 120 (SQL2014) or 130 (SQL2016)
  2. Use command “mofcomp” to compile the mof file.

We tried that and it didn’t succeed.

An error occurred while processing item 10 defined on lines 73 – 79 in file C:\Program Files (x86)\Microsoft SQL Server\110\Shared\sqlmgmproviderxpsp2up.mof:
Error Number: 0x80070005, Facility: Win32
Description: Access is denied.
Compiler returned error 0x80070005

There are two important things in above failure. Error message – “Access is denied” and the line number. If you get error for 4 – 7 then most likely you have not run CMD using “Run As Administrator” but if you get error for some other line (like we got for 73-79) then the problem would be something else.

SOLUTION/WORKAROUND

Since it was an access denied error, I downloaded and run a process monitor and looked for access denied. We found below interesting key related to WMI.

svchost.exe 1023 RegOpenKey HKCR\CLSID\{73E709EA-5D93-4B2E-BBB0-99B7938DA9E4}\LocalServer32 ACCESS DENIED

Now, we know the key which is showing access denied.

SQL SERVER - Configuration Manager - Cannot Connect to WMI Provider. You Do Not Have Permission or The Server is Unreachable mof-comp-02

We checked permission and found that Administrator has full permission on the above key. But access denied was for Network Service account so we added Network service on the above key and then ran the above command (MOFCOMP) again. Since permissions were fixed, we could run the above command successfully. After that SQL Server Configuration Manager just opened fine and we were able to manage the SQL related services successfully.

Reference: Pinal Dave (http://blog.SQLAuthority.com)

Registry, SQL Error Messages, SQL Server, Starting SQL, WMI
Previous Post
SQL SERVER – Login Failed – Server is in Script Upgrade Mode – Deleting Collection Set “Utility Information”
Next Post
SQL SERVER- Error: 18204, Severity: 16 – Backup Failure – Operating System Error 1240 (The Account is not Authorized to Log in From This Station)

Related Posts

26 Comments. Leave new

  • nakulvachhrajani
    May 20, 2017 4:09 pm

    One a related note – We used to run into this a couple of years ago. What we found was that this would be after someone changed the service credentials via services.msc (which is not recommended by Microsoft). We worked to educate the respective teams on the right way to change credentials (via SQL Server Configuration Manager). Once we put our foot down and ensured that this made it’s way into the checklists, the problem with permissions never came up again.

    Reply
  • Yep, the “Run as Administrator” helped for vNext SQL server ver 17.1 on Windows 7 Pro SP 1

    Plain MS-Dos promt gave:
    Microsoft (R) MOF Compiler Version 6.1.7600.16385
    Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
    Parsing MOF file: C:\Program Files (x86)\Microsoft SQL Server\140\Shared\sqlmgmp
    roviderxpsp2up.mof
    MOF file has been successfully parsed
    Storing data in the repository…
    An error occurred while processing item 1 defined on lines 4 – 7 in file C:\Prog
    ram Files (x86)\Microsoft SQL Server\140\Shared\sqlmgmproviderxpsp2up.mof:
    Error Number: 0x80041003, Facility: WMI
    Description: Access denied
    Compiler returned error 0x80041003

    Correct MS-DOS prompt with “Run As Administrator” gave :
    Microsoft (R) MOF Compiler Version 6.1.7600.16385
    Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
    Parsing MOF file: C:\Program Files (x86)\Microsoft SQL Server\140\Shared\sqlmgmp
    roviderxpsp2up.mof
    MOF file has been successfully parsed
    Storing data in the repository…
    Done!

    Yes – same command. Just pasted the text into the DOS window from the last try.

    Reply
    • Up date: SQL 2016 and vNext 2017 are both version 140.
      Working command:
      mofcomp “%programfiles(x86)%\Microsoft SQL Server\140\Shared\sqlmgmproviderxpsp2up.mof”
      SQL 2014 would be
      mofcomp “%programfiles(x86)%\Microsoft SQL Server\130\Shared\sqlmgmproviderxpsp2up.mof”

      Reply
  • I had an additional step when adding NETWORK SERVICE to that key. When opening that key’s permissions, I went to Advanced and changed the Owner to Administrators. That allowed my user to edit the key’s permissions.

    Reply
  • When trying to open MS SQL Server Configuration Manager, a dialog may appear..
    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 class [0x80041010]
    SQL Server Cannot Connect to WMI Provider permissions or server is unreachable

    This is caused by an issue with the compiled SQL Configuration Manager GUI’s communication with WMI.

    Open a command prompt as administrator
    Navigate to your SQL version’s shared directory (cd ):
    SQL 2008: C:\Program Files (x86)\Microsoft SQL Server\90\Shared\
    SQL 2008 R2: 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\
    Then run the following command:
    mofcomp sqlmgmproviderxpsp2up.mof
    MS-SQL-Server-Configuration-Manager-Cannot-Connect-WMI-Provider-Fix

    Reply
  • Great fix, just search from the root of c for sqlmgmproviderxpsp2up.mof, mine was in the 140\shared directory

    I had added an account to my Windows Mail and it had shifted my W10 box to some windows domain cloud authentication and completely trashed the permissions on my SQL Data directories. I couldn’t then look in the config manager to see which account it was trying to run under, all sorted now! Thanks.

    Reply
  • I do not have a folder on my server for C:\Program Files (x86)\Microsoft SQL Server

    I have an mofcomp.exe file located in: C:\Windows\WinSxS\wow64_microsoft-windows-wmi-core_31bf3856ad364e35_6.3.9600.16384_none_b4670d7227f06862

    What do I need to do in my case to fix this?

    Reply
  • In fact, I do have the x86 location and ran the command as per Microsoft’s instructions, restarted the WMI service but the error opening SQL Server Configurations Manager persists. What are my other options?

    Reply
  • works great after added network service account with full rights :)

    thanks dude

    By Hariraj tamilnadu

    Reply
  • Thank you for this, please note that in my case I needed to change the owner of the key in order to give the service account full rights.

    Reply
  • Tijana Vodopija Čikotić
    September 20, 2018 6:52 pm

    you are life saver!
    Thanks
    Tijana

    Reply
  • James Whitted
    May 21, 2019 3:31 am

    Thank you! This solved this exact problem that a customer was having.

    I’ll put you on my list for SQL help when and if we run into a really hard issue.

    Reply
  • svchost.exe 1023 RegOpenKey HKCR\CLSID\{73E709EA-5D93-4B2E-BBB0-99B7938DA9E4}\LocalServer32 ACCESS DENIED

    Now, we know the key which is showing access denied.

    We checked permission and found that Administrator has full permission on the above key. But access denied was for Network Service account so we added Network service on the above key and then ran the above command (MOFCOMP) again. Since permissions were fixed, we could run the above command successfully. After that SQL Server Configuration Manager just opened fine and we were able to manage the SQL related services successfully.

    Please show how you added network service

    Reply
  • Network service Nasıl eklediniz

    Reply
  • please follow below step if upper description will not work

    step:1 Run Cmd as Administrator and execute this commands:

    Step 2:-

    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 2016 C:\Program Files (x86)\Microsoft SQL Server\130\Shared\

    step 3:- run this cd “C:\Program Files (x86)\Microsoft SQL Server\140\Shared”

    Example:-

    C:\WINDOWS\system32>cd “C:\Program Files (x86)\Microsoft SQL Server\140\Shared”

    Step 4:- C:\Program Files (x86)\Microsoft SQL Server\140\Shared>mofcomp sqlmgmproviderxpsp2up.mof

    step 5:- open sql server config manger from start

    it will work for me . hope it will help

    Reply
  • Thanks Pinal for such interesting information.

    Reply
  • helped to fix on SQL2016

    Reply

Leave a Reply