Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

SQL Server Configuration Manager: "Cannot connect to WMI provider" with Invalid class 0x80041010 or Invalid namespace 0x8004100e

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

You open SQL Server Configuration Manager to change a protocol, a port or a service account, and instead of the tree you get a message that starts "Cannot connect to WMI provider. You do not have permission or the server is unreachable." It ends with either "Invalid namespace [0x8004100e]" or "Invalid class [0x80041010]". The message sounds like a permissions or network problem, but Microsoft's page says the codes point to a missing provider registration instead.

Microsoft's explanation is that "This error occurs when the Windows Management Instrumentation (WMI) provider that SQL Server Configuration Manager depends on is no longer registered. It's most often unregistered when you uninstall an instance or a different version of SQL Server from the same computer."

What the error means

SQL Server Configuration Manager (the SQLServerManager<nn>.msc console) uses WMI to read and change some server settings, and, when it connects, to get the status of the SQL Server and SQL Server Agent services. The provider is registered in a WMI namespace named root\Microsoft\SqlServer\ComputerManagement<nn>, where <nn> is the two-digit major version of SQL Server, for example 16 for SQL Server 2022.

Microsoft states that the codes show missing registration, not refused access: "The error codes indicate that the provider registration is missing rather than that access was denied." The two codes mean:

  • Invalid namespace [0x8004100e]: the ComputerManagement<nn> namespace is not in the WMI repository.
  • Invalid class [0x80041010]: the namespace exists, but the classes Configuration Manager expects are not registered in it.

Microsoft's page does not describe either code as meaning that the SQL Server service is down.

This matters for the order of work. A message that mentions permission and an unreachable server invites a hunt through firewall rules, WMI permissions and remote-management settings. Microsoft's page points the other way: the namespace or its classes are simply not there. The check is whether the files that would register them exist, and the repair is to register them.

The same page says that when Configuration Manager connects to a server it uses WMI "to get the status of the SQL Server (MSSQLSERVER) and SQL Server Agent services." The SQL Server service itself is a separate matter, and the page does not say it is affected.

Likely causes

Cause What Microsoft's page says
An instance of SQL Server was uninstalled "This registration is removed when you uninstall an instance of SQL Server"
A different version sharing the same computer was uninstalled The same sentence includes "a different version of SQL Server that shared the same computer"
The MOF file that defines the provider is missing Then there is nothing to compile and the installation needs repair

The page names no other cause. It does not describe antivirus, a damaged WMI repository or a permissions fault.

Prove the cause before changing anything

All of these only read.

  1. Note which exact message you get: Invalid namespace [0x8004100e] or Invalid class [0x80041010].
  2. Note which versions of SQL Server are, or have been, installed on this computer. Ask whether any instance or version was uninstalled recently.
  3. Find the MOF file for your version. It lives in the shared components folder %programfiles(x86)%\Microsoft SQL Server\nnn\Shared. Microsoft's table gives the folder number and file name for each version:
Version nnn MOF file
SQL Server 2025 (17.x) 170 sqlmgmprovider.mof
SQL Server 2022 (16.x) 160 sqlmgmprovider.mof
SQL Server 2019 (15.x) 150 sqlmgmproviderxpsp2up.mof
SQL Server 2017 (14.x) 140 sqlmgmproviderxpsp2up.mof
SQL Server 2016 (13.x) 130 sqlmgmproviderxpsp2up.mof
SQL Server 2014 (12.x) 120 sqlmgmproviderxpsp2up.mof
SQL Server 2012 (11.x) 110 sqlmgmproviderxpsp2up.mof
SQL Server 2008 R2 (10.50.x) 100 sqlmgmproviderxpsp2up.mof
SQL Server 2008 (10.0.x) 100 sqlmgmproviderxpsp2up.mof
SQL Server 2005 (9.x) 90 sqlmgmproviderxpsp2up.mof
  1. If you are not sure which versions are installed or the folder is not where you expect, Microsoft says to list the MOF files across all installed versions from an elevated Command Prompt:
dir "%programfiles(x86)%\Microsoft SQL Server\*.mof" /s

Microsoft adds that on some installations the shared components are under %programfiles% instead of %programfiles(x86)%.

If the file is present, the registration is the likely fault. If it is missing, mofcomp has nothing to compile.

Example (illustrative): at contoso.com.au APP03 ran SQL Server 2019 and SQL Server 2022 side by side. An administrator uninstalled the old 2019 instance, and the next day SQL Server Configuration Manager for 2022 showed "Invalid class [0x80041010]". dir finds sqlmgmprovider.mof in the 160\Shared folder. The file is there, so the provider needs re-registering.

Fix

Recompile the provider with mofcomp

This is Microsoft's first option, for a MOF file that is present.

Save first. Note the exact path of the MOF file and keep a copy of this listing, running it from an elevated Command Prompt. Microsoft's page gives no way to export the current WMI registration, so there is nothing to save beyond the path and the message text.

dir "%programfiles(x86)%\Microsoft SQL Server\*.mof" /s

Risk: The next command registers the SQL Server WMI provider in the computer's WMI repository, and the step after it restarts the Windows Management Instrumentation service, which interrupts anything on that server that is using WMI until the service is back. Do it when that does not matter, and on a hosted server tell the people who use it first.

  1. Open Command Prompt as an administrator (select Start, enter cmd, right-click Command Prompt, select Run as administrator).
  2. Run mofcomp against the full path of the MOF file for your version. Microsoft says the full path avoids a file-not-found error when the prompt is not in the file's folder. For SQL Server 2022 (16.x) and later, Microsoft's command is below, with 160 replaced by the nnn value for your version:
mofcomp "%programfiles(x86)%\Microsoft SQL Server\160\Shared\sqlmgmprovider.mof"

For SQL Server 2019 (15.x) and earlier, Microsoft's command is below, with 150 replaced by your nnn value:

mofcomp "%programfiles(x86)%\Microsoft SQL Server\150\Shared\sqlmgmproviderxpsp2up.mof"
  1. Restart the WMI service so the change takes effect. Microsoft says to open the Services app, select Windows Management Instrumentation, and select Restart, or, from an administrator PowerShell, run:
Get-Service winmgmt | Restart-Service -Force

To undo it: Microsoft's page gives no command that removes the registration again, and the compile only restores what SQL Server's own setup registered, so there is nothing of yours to put back. The restart of the WMI service has no undo; once it has restarted, it is simply running again. If the command reports that the file cannot be found, nothing was changed; check the path from the dir listing.

Repair the installation

Microsoft's second option applies only when the MOF file is missing from the Shared folder: "run SQL Server Setup in repair mode to restore the missing files and registry entries." The page points to "Repair a failed SQL Server installation" for the steps. Microsoft says to use this option only when the MOF file is missing, because with the file present, recompiling it "is faster and doesn't require the installation media." Repair of a production instance changes installed files and needs the installation media, so plan it as a change. Microsoft's page gives no way to undo a repair.

Confirm the fix

  • Open SQL Server Configuration Manager again. The tree for SQL Server Services and SQL Server Network Configuration should load without the WMI message.
  • Open SQL Server Services and check the SQL Server and SQL Server Agent services show their status. Microsoft says Configuration Manager reads that through WMI.

What to watch afterwards

  • Which console you use. Microsoft's page names the console as SQLServerManager<nn>.msc, one per version, and its table gives each version its own folder and MOF file. A server that has run several versions needs the check made for the version of the console that fails, not for the newest instance.
  • Uninstalling an instance or another SQL Server version on the same computer. Microsoft says that removes the registration, so re-check Configuration Manager afterwards.
  • A Configuration Manager for an older version. Each version has its own nnn folder and its own MOF file, so each console may need its own check.

Risks and limits

These commands have not been run in a lab. Microsoft's page documents two causes of missing registration (an uninstall, or a missing MOF file) and does not cover a damaged WMI repository or a permissions fault on the WMI namespace. The page does not list which services or tools on the server depend on WMI, so check that for your server before restarting it.

Sources