SCCM : Customizing the hardware inventory to report a custom registry file.

August 29, 2008 at 8:29 am in ConfigMgr, ConfigMgr 2007, sccm, SMS by Kenny Buntinx [MVP]

Configuration Manager 2007 inventories hardware information about clients based on the contents of two Managed Object Format (MOF) files stored on the primary site server in the <ConfigMgr install directory>\inboxes\clifiles.src\hinv directory. The two MOF files used by hardware inventory processes are the Configuration.mof and SMS_def.mof MOF files.

About the Configuration.mof File :

The Configuration.mof file is used to define the data classes to be inventoried by the hardware inventory client agent. Data classes can be created to inventory existing or custom WMI repository data classes or registry keys present on client systems.The Configuration.mof also defines and registers the WMI providers used to access computer information during hardware inventory. Registering providers defines the type of provider to be used and the classes that the provider supports. WMI, and Configuration Manager 2007 hardware inventory can only access registered providers.

About the SMS_def.mof File :

The SMS_def.mof file defines the reporting classes used by the hardware inventory client agent to determine whether or not specific client data class information is reported. Reporting classes are based on the WMI repository data classes, and attributes of those classes, existing on clients by default or added to them by customizing the Configuration.mof file.Reporting class information in the SMS_def.mof file is converted into a reporting policy provided to clients during their normal computer policy polling interval. After the client compiles the new reporting policy, the reporting policy information is stored in the client system WMI repository in the InventoryDataItem class of the Root\CCM\Policy\Machine WMI namespace.

Inventory individual registry keys

My customer wants to inventories on the old windows 2000 machines all the software that was installed by the Compaq staging Framework before they will roll-out new hardware. The Compaq staging framework has written a registry entry for each installed software at the following registry place as show below.

HLKM\Software\CompaqStagingFramework\InstalledSoftware.

In the SCCM 2007 Hardware inventory it will not inventories custom registry keys by default

image

1.Adapting the configuration.mof File.


The data section, to be placed at the bottom of configuration.mof

(Remark : Enter the values you want in bold)

//========================

// Added extensions start

//========================

#pragma namespace(“\\\\.\\root\\cimv2″)

#pragma deleteclass(“Win32Reg_CSFAudit“,NOFAIL)

[ dynamic,

provider(“RegProv”),

ClassContext(“local|HKEY_LOCAL_MACHINE\\Software\\CompaqStagingFramework\\InstalledProducts“)

]

class Win32Reg_CSFAudit (Remark :define your custom wmi value here)

{

[Key] string ApplicationName;

[PropertyContext(“KitName“)] string KitName;

[PropertyContext(“KitVersion“)] string KitVersion;

[PropertyContext(“ProdVersion“)] string ProdVersion;

};

//========================

// Added extensions end

//========================

 

2.Adapting the sms_def.mof file.


The reporting section, to be placed at the bottom of sms_def.mof

//========================

// Added extensions start

//========================

#pragma namespace (“\\\\.\\root\\cimv2\\sms”)

#pragma deleteclass(“Win32Reg_CSFAudit“,NOFAIL)

[ SMS_Report (TRUE), (Remark : Value could be FALSE or TRUE)

SMS_Group_Name (“Compaq Staging Framework Inventory“), (Remark : This will be the display name you want to define in Health explorer)

SMS_Class_ID (“MICROSOFT|Compaq_Staging_Framework_inventory|1.0″) ]

class Win32Reg_CSFAudit : SMS_Class_Template

{

[SMS_Report (TRUE), Key ] string ApplicationName;

[SMS_Report (TRUE)] string KitName;

[SMS_Report (TRUE)] string KitVersion;

[SMS_Report (TRUE)] string ProdVersion;

};

//========================

// Added extensions end

//========================

3. Resource Explorer :



In Resource Explorer, the values will look like this :

image


 


Many Thanks to Jeff Gilbert to help me understand this !


Hope it helps !


 


Kenny Buntinx

Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInPin on Pinterest