Network Card inventory

I want to inventory the network card information on my managed computers, details like model, driver version etc.  My clients are Win7 x64 managed by SCCM 2012 R2 CU3.

I've found a nice article that describes doing this using the Regkey to MOF tool http://blogs.technet.com/b/configmgr_geek_speak/archive/2013/11/10/inventorying-and-reporting-network-adapter-driver-details-and-how-to-report-only-the-wireless-type-in-configuration-manager-2012.aspx

I've used Regkey to MOF in the past successfully, but when I navigate to the regkey in this article, and copy/paste the code from the "to import in admin/agent settings... tab", then try to import it into my CAS under default client settings, I get "The MOF file you tried to import could not be compiled".

I also try to check the MOF file i'm trying to import using the MOFcomp utility, which kicks out the error "Unexpected character in class name (must be an identifier).

Is there something more that needs to be done to the Class Name to get this to successfully pass the mofcomp check?  The class name is {4D36E972-E325-11CE-BFC1-08002BE10318}

Tony

March 23rd, 2015 5:50pm

Can you post your MOF edits.
Free Windows Admin Tool Kit Click here and download it now
March 23rd, 2015 7:10pm

Sure, below is the content of the MOF,

// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich & Kent Agerlund)
// this section tells the inventory agent what to report to the server
// 3/23/2015 4:36:54 PM

#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("{4D36E972-E325-11CE-BFC1-08002BE10318}", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("{4D36E972-E325-11CE-BFC1-08002BE10318}"),SMS_Class_ID("{4D36E972-E325-11CE-BFC1-08002BE10318}"),
SMS_Context_1("__ProviderArchitecture=32|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class {4D36E972-E325-11CE-BFC1-08002BE10318}: SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String Class;
[SMS_Report(TRUE)] String ClassDesc;
[SMS_Report(TRUE)] String TheDefault;
[SMS_Report(TRUE)] String IconPath[];
[SMS_Report(TRUE)] String Installer32;
[SMS_Report(TRUE)] String EnumPropPages32;
[SMS_Report(TRUE)] String LowerLogoVersion;
};

Tony

March 24th, 2015 9:51am

post your configuration.mof snippet as well, please
Free Windows Admin Tool Kit Click here and download it now
March 24th, 2015 12:24pm

Hi Sherry, below is configuration.mof snippet

// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich & Kent Agerlund)
// this section tells the inventory agent what to collect
// 3/24/2015 8:46:11 AM

#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("{4D36E972-E325-11CE-BFC1-08002BE10318}", NOFAIL)
[DYNPROPS]
Class {4D36E972-E325-11CE-BFC1-08002BE10318}
{
[key] string KeyName;
String Class;
String ClassDesc;
String TheDefault;
String IconPath[];
String Installer32;
String EnumPropPages32;
String LowerLogoVersion;
};

[DYNPROPS]
Instance of {4D36E972-E325-11CE-BFC1-08002BE10318}
{
KeyName="RegKeyToMOF_32";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}|Class"),Dynamic,Provider("RegPropProv")] Class;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}|ClassDesc"),Dynamic,Provider("RegPropProv")] ClassDesc;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}|"),Dynamic,Provider("RegPropProv")] TheDefault;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}|IconPath"),Dynamic,Provider("RegPropProv")] IconPath;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}|Installer32"),Dynamic,Provider("RegPropProv")] Installer32;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}|EnumPropPages32"),Dynamic,Provider("RegPropProv")] EnumPropPages32;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}|LowerLogoVersion"),Dynamic,Provider("RegPropProv")] LowerLogoVersion;
};

March 24th, 2015 2:42pm

Well I think I'm a little closer, I saw this old post and think my issue is related to what is mentioned here - can't have a class name with the { symbol.  But the regkey I am trying to capture starts and ends with a {, this is the key I need and it does exist on all of my machines.

I did try to rename my classname to GUID_OEM per the post, , but doing that kicks out mofcomp error "Expected property or method name".

Here's the relevant piece of the old post:

Just a guess, but I suspect it is rejecting the special characters { } in the label.  As you can tell, those characters are used by the mof syntax itself to open and close the instances.  So you can't use those in the label.  In the regkey within the quotes, sure; the labeling something with those special characters makes it reject the edit.

Either remove all the instances of the {c9504...} attribute request, or; if you do need that specifically named attribute (which I doubt... you may want to check on another sample computer, and confirm that a regkey of that *exact* name is on every single image in your environment).  But, presuming it is, you can change the label to be something like...

[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion|{C950420B-4182-49EA-850A-A6A2ABF06C6B}_OEM"),Dynamic,Provider("RegPropProv")] GUID_OEM;

and of course, change that label in the other locations:

Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2015 2:51pm

Yes, I know this is an old post, but Im trying to clean them up. Did you solve this problem, if so what was the solution?

July 4th, 2015 5:59pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics