Tuesday, June 14, 2011

SQL Server Configuration Manager Cannot Connect to WMI Provider

Today when I go to the SQL Server Configuration Manager utility, this error was coming:

“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 the SQL Server Configuration Manager. Invalid namespace[0x80041010]"

After lot of searching, I found the solution. Go to a command prompt and then run mofcomp. The syntax is: 

mofcomp "%programfiles(x86)%\Microsoft\Microsoft SQL Server\100\Shared\sqlmgmproviderxpsp2up.mof"

Note: The sqlmgmproviderxpsp2up.mof file must be present in the %programfiles(x86)%\Microsoft\Microsoft SQL Server\100\Shared folder. If you do not see this file in above location then you can search this for this file on that server and then you can refer the new location in the command above. The output will look like below

Microsoft (R) 32-bit MOF Compiler Version 5.1.2600.2180
Copyright (c) Microsoft Corp. 1997-2001. All rights reserved.
Parsing MOF file: C:\Program Files\Microsoft SQL Server\90\Shared\sqlmgmprovider
MOF file has been successfully parsed
Storing data in the repository...
On servers, the .mof file will be sqlmgmprovider.mof.

The reason to this problem was:

When you install a 32-bit version of Microsoft SQL Server 2008 on 64-bit machine and you install an 64-bit version of SQL Server 2008 on the same machine. If you uninstall any instances you will receive the error message when you open SQL Server Configuration Manager.
Here is a screen shot of the error:

This problem occurs because the WMI provider is removed when you uninstall an instance of SQL Server 2008. The 32-bit instance and the 64-bit instance of SQL Server 2008 share the same WMI configuration file. This file is located in the %programfiles(x86)% folder.
The WMI (Windows Management Instrumentation) provider is a published layer that is used with the SQL Server Configuration Manager snap-in for Microsoft Management Console (MMC) and the Microsoft SQL Server Configuration Manager. It provides a unified way for interfacing with the API calls that manage the registry operations requested by SQL Server Configuration Manager and provides enhanced control and manipulation over the selected SQL Server services. The SQL Server WMI Provider is a DLL and a MOF file, which are compiled automatically by SQL Server Setup.

Microsoft SQL Server provides the WMI Provider for Configuration Management. This lets you use Windows Management Instrumentation (WMI) to manage SQL Server services, SQL Server client and server network settings, and server aliases. SQL Server services, network settings, and aliases are represented by WMI objects in the root\Microsoft\SqlServer\ComputerManagement10 namespace of the computer. After a connection is established with the WMI provider on the specified computer, the services, network settings, and aliases can be queried using WQL or a scripting language.

1 comment:

  1. Hi,

    I am getting the following error while executing the command

    "An error occurred while opening the namespace for object 1 defined on lines 4 -
    Error Number: 0x80070437, Facility: Win32
    Description: The account specified for this service is different from the accoun
    t specified for other services running in the same process.
    Compiler returned error 0x80070437"

    Avinash Udawant