How to get registry information into hardware inventory


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. 


The tool

You can downlaod RegKeyToMof.exe from

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.


  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 to something meaningful like IE version.


  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.


    This is the information I copied:
    #pragma deleteclass("IE", NOFAIL)
    Class IE
    [key] string KeyName;
    String Version;
    Instance of IE
    [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.


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


    This is the information I copied:
    #pragma namespace ("\\\\.\\root\\cimv2\\SMS")
    #pragma deleteclass("IE", NOFAIL)
    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.


This post was orginally posted to

By |2009-10-23T09:22:07+00:00October 23rd, 2009|Configuration Manager (SCCM), General info|10 Comments

About the Author:

Kent Agerlund
Microsoft Regional Director, Enterprise Mobility MVP. Microsoft Certified Trainer and Principal consultant. I have been working with Enterprise client management since 1992. Co-founder of System Center User Group Denmark in 2009. Certified MCITP: Enterprise Administrator, MCSA+Messaing, and much more. Member of: Microsoft Denmark System Center Partner Expert Team The Danish Technet Influencers program System Center Influencers Program.


  1. brisbane injury compensation March 25, 2012 at 21:35 - Reply

    After reading the whole topic, I reached in the conclusion that this is an interesting post and thanks for sharing.Some things in here I have not thought about before.Thanks for making such a cool post which is really very well written.will be referring a lot of friends about this.Keep blogging and informating us such great ways.brisbane injury compensation

  2. GregInAtlanta April 21, 2014 at 9:02 - Reply

    Can you help me write a Query so I can pull that information into a collection in SCCM 2007? Man I need this help asap. My job is on my back. I will keep searching myself too. Thanks Kent. This little tool is the you know what!

  3. Kent Agerlund April 21, 2014 at 10:45 - Reply

    GregInAtlanta – Do you have the data in the database yet?

  4. Kent Agerlund April 21, 2014 at 10:46 - Reply

    Do you have the data in the database?

  5. Vikram April 16, 2015 at 11:19 - Reply

    Hey Kent,

    How can we get this reg key information in the form of a report ?


  6. Aaron April 21, 2015 at 16:36 - Reply

    Hey Kent. When I modify the configuration.mof file, it does not save my changes. Any thoughts?

    • Vikram April 22, 2015 at 12:36 - Reply

      Hey Aaron,

      Did you make sure the configuration under default client settings under Administration? The default client settings should have the classes checked properly as well.

      • Vikram April 22, 2015 at 12:41 - Reply

        Also check the dataldr.log when you are trying to save the configuration.mof file as this will show you the exact details.

  7. Chris Lennon March 14, 2017 at 14:09 - Reply

    Hi Kent

    I am capturing data for last logged on user/date and time?

    I have used your example and used the tool to select specific registry values created by another script run at login.

    I am not convinced that the collection of these values are being overwritten. Do I need to amend anything in the scripts to show the latest values put down in the registry.

    Kind Regards

Leave A Comment