Extending the hardware inventory in ConfigMgr 2012

From time to time I need to extend the hardware inventory collected from servers and clients. In this post I’ll try to explain how to configure the hardware inventory to pick up data from a registry key.

I created the following key on a Lab computer for testing purposes.


“What does the sheep say”=”baaaaaaaaaaah”

To create the mof extention I usually use this awesome tool: http://myitforum.com/cs2/files/folders/proddocs/entry152945.aspx

The mof ended up looking like this (note: This is not the default output from the tool)

 #pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("TheSheep", NOFAIL)
Class TheSheep
[key] string Name;
String Value;

Instance of TheSheep
Name="What does the sheep say";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\TheSheep|What does the sheep say"),Dynamic,Provider("RegPropProv")] Value;

Download the configuration.mof file to a test computer. The file is located in <ConfigMgr install directory>\inboxes\clifiles.src\hinv) on your primary site server, add the mof extension to the bottom of the configuration.mof file.

// Added extensions start


// Added extensions end

Compile the configuration.mof file on your test computer by opening an elevated command prompt and typing:

Mofcomp.exe <Path to configuration.mof>

In the SCCM console go to your client policies and select hardware inventory, then click the Set Classes button.

Click the add button

Connect to the test computer where you just compiled your custom configuration.mof file.
Then select the class you would like to pick up with your hardware inventory. Click ok to save your changes

Go to your test computer with the custom configuration.mof then run the following from the ConfigMgr agent:

  1. Machine policy retrieval and evaluation cycle
  2. Run Hardware inventory cycle

Look in the InventoryAgent.log to see if your new class is beeing picked up by the hardware inventory cycle.

When the inventory process has finished look in the dataldr.log on your primary site server to see if the inventory data was successfully uploaded.

You should now see your custom class in the resource Explorer for your test computer