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:
- Always create a backup of the files.
- 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 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.
- Run the tool on a computer that has the application installed.
- In the application navigate to the registry key.
- Modify the name of the Classgroup and the Classname. In my example I changed the names to IE
- Delete any entries that you don’t want to collect and change the Key name from Systemcenter.fr to something meaningful like IE version.
- 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)
[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;}
- Back in the tool select the SCCM SMS_Def.mof tab and copy all the information.
- 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)
[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;
}; - 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 http://scug.dk/blogs/configurationmanager/archive/2009/10/21/how-to-get-registry-information-into-hardware-inventory.aspx
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
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!
GregInAtlanta – Do you have the data in the database yet?
Do you have the data in the database?
Hey Kent,
How can we get this reg key information in the form of a report ?
Thanks
Hey Kent. When I modify the configuration.mof file, it does not save my changes. Any thoughts?
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.
Also check the dataldr.log when you are trying to save the configuration.mof file as this will show you the exact details.
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
[…] http://www.enhansoft.com/blog/how-to-use-regkeytomof http://blog.coretech.dk/kea/how-to-get-registry-information-into-hardware-inventory/ […]
Hi Kent,
Is there any options to capture the binary type registry values in ConfigMgr/ We have tried using the RegKeyToMOF tool but not captured.