SCCM 2007- Adding registry key to hardware inventory, only shows the Key Name, won't show value???
-
martedì 29 maggio 2012 04:00
I'm using SCCM 2007 SP2 R2. On one of my Windows 7 clients I have added the following REG_DWORD registry entry to identify the build number:
HKLM\Software\XPVersion\Build\Build Number
Build Number has a Hex value of 1 (0x00000001)
I have modified my Configuration.mof and SMS_DEF.mof to collect the key with hardware inventory. I used the Regkey to Mof tool and made a few changes. Here are the entries I added to the two .MOF files:
SMS_DEF.MOF- added the following to the bottom of the file:
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("XPbuild", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("XPbuild"),SMS_Class_ID("XPBuild|XPbuild|1.0")]
Class XPbuild: SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] Uint32 BuildNumber;
};CONFIGURATION.MOF- added the following to the bottom of the file:
#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("XPbuild", NOFAIL)
[DYNPROPS]
Class XPbuild
{
[key] string KeyName;
Uint32 BuildNumber;
};
[DYNPROPS]
Instance of XPbuild
{
keyname="XPbuild";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\XPVersion\\Build|Build Number"),Dynamic,Provider("RegPropProv")] BuildNumber;
};Both files compile with no errors. There are no errors in dataldr.log when I replace the files in clifiles.src\hinv. If I look in WMI on the client I can see the two properties, Keyname=XPbuild and BuildNumber=1. Furthermore, the client's inventoryagent.log file says,
"Collection: Namespace = \\.\root\cimv2;Query = SELECT __CLASS, __PATH, __RELPATH, BuildNumber, Keyname FROM XPbuild; Timeout=600 secs.
There's no indication of an error that I can find.
However, when I look in resource explorer for the client the only property I see is the Key Name XPbuild, it does not report Build Number.
Can anybody tell me what I'm missing? I need to report the Build Number with my hardware inventory?
Thanks,
Jan
- Spostato Rob Marshall - MVPMVP martedì 29 maggio 2012 15:41 Moving from General to Inventory (From:Configuration Manager 2007 General)
Tutte le risposte
-
martedì 29 maggio 2012 08:08
-
martedì 29 maggio 2012 14:53Thanks for the links, I have read through the post and gone through some of Sherry's snippets to compare them to what I have. As far as I can tell my syntax is correct in the two MOF files. Is there any way for me to narrow-down the problem?
-
martedì 29 maggio 2012 15:09Have you already queried the SQL database? The view should be named v_GS_XPbuild0. Does the buildnumber show up there?
Torsten Meringer | http://www.mssccmfaq.de
-
martedì 29 maggio 2012 17:40
Hi Torsten,
No, the buildnumber doesn't show up there, only the Keyname. So it looks like something is preventing buildnumber from being written to the table? Is there a tweak I need to make in SQL?
-
martedì 29 maggio 2012 19:02Moderatore
No, there's no tweak you need to make to SQL.
Personally, I'd scrap what you have, and use RegKeytoMof to build my snippets for me. I don't think you used regkeytomof, or if you did, you used a really, really old version.
http://tinyurl.com/regkeytomof26Standardize. Simplify. Automate.
- Contrassegnato come risposta Janet Schiller mercoledì 30 maggio 2012 02:22
-
martedì 29 maggio 2012 21:27
Thanks Sherry,
I used RegKeytoMof but it is probably an old version like you said. I'm going to download the new version and start from scratch tonight. I'll post back here with results.
-
mercoledì 30 maggio 2012 02:22
Sherry, you called it! I used the new version of regkeytomof. The version I used previously didn't include the x64 checkbox, so it was definitely old.
Thanks for posting all that info in the MyITForum blog & wicki from your link!!!!!
I tried it twice, first time it didn't work and the second time it did (the first time the client's inventoryagent.log never included my change, maybe bad client or ??).
Thanks for your help,
Jan

