When the hardware inventory agent is running it’s looking after values in the local WMI database on the client. By default WMI contains much valuable information that is “easy” to collect. But from time to time we need to gather information that’s not yet part of WMI. This post will guide you through the process of getting those information using a tool developed by Mark Cochrane.

The ConfigMgr. files

On the Configuration Manager Site server two files are used to control the hardware inventory data process:

  • SMS_DEF.mof
    • This file contains information about the WMI data classes used by hardware inventory during the scanning.
  • Configuration.mof
    • Entries in this file is used to generated the data classes that a collected by the hardware inventory agent

Both files are place in .\Program files\Microsoft Configuration Manager\inboxes\clifiles.src\hinv. Before modifying the files a few word of advice:

  1. Always create a backup of the files.
  2. Only modify a single class at the time. Once you have modified/added/deleted a class save the changes while monitoring the dataldr.log file on the site server. The log file will contain information about processing the changes. 

    image

The tool

You can downlaod RegKeyToMof.exe from http://www.myitforum.com/inc/upload/12336RegKeyToMOF.zip

How to get information from the reigstry into hardware inventory

In this example I will use the tool to grab information about the Internet Explorer version installed. The information is stored in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ along with other IE information.

  1. Run the tool on a computer that has the application installed.
  2. In the application navigate to the registry key.

    image

  3. Modify the name of the Classgroup and the Classname. In my example I changed the names to IE
  4. Delete any entries that you don’t want to collect and change the Key name from Systemcenter.fr to something meaningful like IE version.

    image

  5. Copy everything and paste the information into the Configuration.mof file. The information will automatically be stored in the database when you save the file. Clients will pick up the changes next time they perform a machine refresh cycle. I prefer to paste new information into the end of the file.

    image

    This is the information I copied:
    #pragma deleteclass("IE", NOFAIL)
    [DYNPROPS]
    Class IE
    {
    [key] string KeyName;
    String Version;
    };
    [DYNPROPS]
    Instance of IE
    {
    keyname="IE.version";
    [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Internet Explorer|Version"),Dynamic,Provider("RegPropProv")] Version;

    }

  6. Back in the tool select the SCCM SMS_Def.mof tab and copy all the information.

    image

  7. Paste the information into the SMS_def.mof file and save the file.

    image

    This is the information I copied:
    #pragma namespace ("\\\\.\\root\\cimv2\\SMS")
    #pragma deleteclass("IE", NOFAIL)
    [SMS_Report(TRUE),SMS_Group_Name("IE"),SMS_Class_ID("IE|IE|1.0")]
    Class IE: SMS_Class_Template
    {
    [SMS_Report(TRUE),key] string KeyName;
    [SMS_Report(TRUE)] String Version;
    };

  8. Next time client performs a hardware inventory scanning they will automatically collect the information which will then be added to the database. You will be able to view the information in Resource Explorer, create queries etc.

    image

This post was orginally posted to http://scug.dk/blogs/configurationmanager/archive/2009/10/21/how-to-get-registry-information-into-hardware-inventory.aspx