Being unable to open SQL Server Configuration Manager if often caused by a corrupt or removed WMI provider for SQL Server. This post explains how to resolve this.
This post shows you how to recompile Managed Object Format (.mof) in Windows to resolve an issue where you cannot open SQL Server Configuration Manager.
Just a quick note: recompile all possibly available SQL WMI provider .mof files using mofcomp (Managed Object Format (MOF) compiler). This resolves these errors:
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]
or
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]
# For Microsoft SQL Server 2005 through Microsoft SQL Server 2019
& C:\Windows\System32\wbem\mofcomp.exe (Get-ChildItem -Recurse "C:\Program Files (x86)\Microsoft SQL Server\*\Shared\sqlmgmproviderxpsp2up.mof" | Select-Object FullName).FullName
# SQL Server 2022
& C:\Windows\System32\wbem\mofcomp.exe (Get-ChildItem -Recurse "C:\Program Files (x86)\Microsoft SQL Server\*\Shared\sqlmgmprovider.mof" | Select-Object FullName).FullName
Get-Service winmgmt | Restart-Service -Force
Cause
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 %programfiles(x86)%
folder.
Source: 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 on Microsoft Learn.
Managed Object Format (MOF)
Managed Object Format (MOF) is the language used to describe Common Information Model (CIM) classes.
The recommended way for WMI providers to implement new WMI classes is in MOF files which are compiled using Mofcomp.exe into the WMI repository. It is also possible to create and manipulate CIM classes and instances using the COM API for WMI.
A WMI provider normally consists of a MOF file, which defines the data and event classes for which the provider returns data, and a DLL file which contains the code that supplies data. For more information, see Providing Data to WMI.
WMI client scripts and applications can query for instances of provider MOF classes or subscribe to receive event notifications.
See Managed Object Format (MOF) on Microsoft Learn for more information.