Jeff Gilbert's Web blog at myITforum.com

This posting is provided "AS IS" with no warranties, and confers no rights :-)
How to inventory SQL Server 2005 installations via SMS 2003/Configuration Manager 2007 hardware inventory

I've been meaning to blog this for quite some time, and today I finally found some time to do it...at least partially. I made some MOF edits for MMS 2007 to demonstrate how to query for installed SQL Server 2000 and SQL Server 2005 installations using Configuration Manager hardware inventory. These edits work with SMS 2003 as well and I've actually modified the edits to account for SMS 2003 in this posting (the #pragma namespace change lines aren't needed for Configuration Manager 2007 as the data classes are in a totally separate file (Configuration.mof) from the reporting classes (SMS_def.mof)). 

Below are the MOF edits for querying SQL Server 2005 installed components and instances. I've also posted some Resource Explorer screen shots so you can see what it looks like after the data is inventoried on a machine. I'll post the edits for inventorying SQL 2000 soon as well. I have to dig them up, but I think SQL 2000 MOF edits actually gave the version (Enterprise, Standard, etc…) as well.

These MOF edits are useful to determine who has a full version of SQL 2005 installed (and how many instances) versus just the admin tools at least. Anyway, below are the mof edits:  
 

Data Class
#pragma namespace ("\\\\.\\root\\cimv2")
//--------------------------------------------------------------------------
// Begin SQL 2005 Installed Components Data Class
//--------------------------------------------------------------------------

[dynamic, provider("RegProv"),
ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SQL Server\\90\\Uninstall Info")]

Class InstalledSQLComponents
{
     [Key] String Component;
     [PropertyContext("Product")] String Product;
};

 

Reporting Classes
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
//---------------------------------------------------------------------------------
// Begin SQL 2005 Installed Components Reporting Class
//---------------------------------------------------------------------------------

[SMS_Report(TRUE),
SMS_Group_Name("SQL Server Installed Components"),
SMS_Class_ID("MICROSOFT|Installed_SQL_Components|1.0") ]

Class InstalledSQLComponents
{
     [SMS_Report(TRUE),Key] string Component;
     [SMS_Report(TRUE)] String Product;
};

//----------------------------------------------------------------
// Begin SQL 2005 Instances Reporting Class
//----------------------------------------------------------------

[SMS_Report (TRUE),
SMS_Group_Name ("SQL Server Installed Instances"),
Namespace   ("root\\\\Microsoft\\\\SqlServer\\\\ComputerManagement"),
SMS_Class_ID   ("MICROSOFT|SQL_Instances|1.0") ]

Class ServerSettings : SMS_Class_Template
{
    [SMS_Report (TRUE),Key] string InstanceName;
};

Resource Explorer screen shots:

SQL 2005 Installed Components

SQL 2005 Installed Instances

 

 You can get this MOF edit (as a .txt file) by right clicking HERE and selecting Save As...

 

Published Monday, August 06, 2007 7:57 PM by jgilbert

Comments

# Finding Installed Editions of SQL Server Using SMS 2003 Hardware Inventory@ Sunday, January 27, 2008 5:15 PM

If you're running SMS 2003 SP2 (or earlier versions of SMS 2003) then inventorying SQL Server installations

Jeff Gilbert's Web blog at myITforum.com