Error message when you open SQL Server Configuration Manager in SQL Server: Cannot connect to WMI provider. You do not have permission or the server is unreachable
This article helps you work around the problem that occurs when you open SQL Server Configuration Manager.
Original product version: SQL Server
Original KB number: 956013
You may receive one of the following error messages when you open 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 namespace [0x8004100e]
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 Configuration Manager use Window Management Instrumentation (WMI) to view and change some server settings. When connecting to servers, SQL Server Configuration Manager uses WMI to obtain the status of the SQL Server (MSSQLSERVER) and SQL Server Agent services. This problem occurs because the WMI provider is removed when you uninstall an instance of SQL Server.
This file is located in the
The MOF file for your SQL instance is found in the
%programfiles(x86)%\Microsoft SQL Server\nnn\Shared folder. Determine the location of the MOF file for your version, using the following table as a reference:
|Microsoft SQL Server 2022||160||
|Microsoft SQL Server 2019||150||
|Microsoft SQL Server 2017||140||
|Microsoft SQL Server 2016||130||
|Microsoft SQL Server 2014||120||
|Microsoft SQL Server 2012||110||
|Microsoft SQL Server 2008 R2||100||
|Microsoft SQL Server 2008||100||
|Microsoft SQL Server 2005||90||
You can use one of the following options to solve the problem.
Option 1: Recompile SQL WMI provider using mofcomp (Managed Object Format (MOF) compiler)
Use the following procedure:
Open an elevated command prompt, and change the directory to the folder location from Step 1.
For SQL Server 2022 and later versions, type the following command, and then press Enter:
For SQL Server 2019 and earlier versions, type the following command, and then press Enter:
For this command to succeed, the MOF file must be present in the
%programfiles(x86)%\Microsoft SQL Server\nnn\Sharedfolder.
After you run the mofcomp tool, restart the WMI service for the changes to take effect. To do this, open Services application, select Windows Management Instrumentation, and then select Restart. You can also restart the WMI service by running the following PowerShell command as administrator:
Get-Service winmgmt | Restart-Service -Force
Option 2: Repair your SQL Server installation. For further information review Repair a Failed SQL Server Installation
This option is only required if the MOF is missing from the
%programfiles(x86)%\Microsoft SQL Server\nnn\Shared location.