I am new to System Center and was hoping to get some help from the community to 
query custom registry values.  If this is the not the right area for this, 
please let me know.

Problem
I get an error telling me that "The MOF file you tried to import could not be 
compiled. Ensure that the MOF file contains valid data. You can use the command 
line mofcomp utility to test the data." when importing a .mof file produced by 
RegKeyToMOF.

Setup
System Center 2012 R2 Configuration Manager on Server 2012r2
RegKeyToMOF v3.1 July 12 (this appeared to be the recommended tool to help 
build the mof files based on some reading, but if there is another tool to use, 
please let me know)

Goal
I would like to view the SNMP PermittedManagers key at 
HKLM\SYSTEM\CurrentControlSet\services\SNMP\Parameters\PermittedManagers for 
any values that exist for each device.

Steps Taken

1.      I ran RegKeyToMOF and pointed to the registry key above.

2.      Copied and pasted the code from the configuration.mof tab under 
ConfMgr12 tab into D:\Program Files\Microsoft Configuration 
Manager\inboxes\clifiles.src\hinv\configuration.mof and then saved it (I have 
included the code in configuration.mof append.txt).

3.      Went into the Set Classes import area and attempted to import 
SNMP-PermittedManagers.mof (attached), but this failed with:
"The MOF file you tried to import could not be compiled. Ensure that the MOF 
file contains valid data. You can use the command line mofcomp utility to test 
the data.".

Troubleshooting Steps

1.      I repeated the steps several times using the steps listed at:
http://be.enhansoft.com/post/2014/02/13/How-to-Use-RegKeyToMof.aspx
http://it.peikkoluola.net/2013/06/20/extend-sccm-client-hardware-inventory-with-a-custom-attribute-value


2.      I attempted to de-select "Enable 64bits (forRegkeys not written in 
Wow6432Node)" and reimported the data.


3.      I tried to restart the SCCM console after appending the data to 
configuration.mof.


4.      Checked that the SCCM server (which is where I am importing this .mof 
file from) has these registry key and 3 values.


5.      Ran SCCM console as admin.


6.      Ran mofcomp as suggested in the error message and got "error SYNTAX 
0x8004400c: Expected property or method name" on line 13.  However, I am not 
sure what the problem with line 13.  Line 13 in the .mof file reads:
[SMS_Report(TRUE)] String 1;


Any help would be appreciated.

Thanks,

-Aakash Shah




// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich 
& Kent Agerlund)
// this section tells the inventory agent what to collect
// 3/24/2015 5:41:14 PM

#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("PermittedManagers", NOFAIL)
[DYNPROPS]
Class PermittedManagers
{
[key] string KeyName;
String 1;
String 2;
String 3;
};

[DYNPROPS]
Instance of PermittedManagers
{
KeyName="RegKeyToMOF_32";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\PermittedManagers|1"),Dynamic,Provider("RegPropProv")]
 1;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\PermittedManagers|2"),Dynamic,Provider("RegPropProv")]
 2;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\PermittedManagers|3"),Dynamic,Provider("RegPropProv")]
 3;
};

#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("PermittedManagers_64", NOFAIL)
[DYNPROPS]
Class PermittedManagers_64
{
[key] string KeyName;
String 1;
String 2;
String 3;
};

[DYNPROPS]
Instance of PermittedManagers_64
{
KeyName="RegKeyToMOF_64";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\PermittedManagers|1"),Dynamic,Provider("RegPropProv")]
 1;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\PermittedManagers|2"),Dynamic,Provider("RegPropProv")]
 2;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SNMP\\Parameters\\PermittedManagers|3"),Dynamic,Provider("RegPropProv")]
 3;
};

// 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/24/2015 5:41:14 PM

#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("PermittedManagers", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("PermittedManagers"),SMS_Class_ID("PermittedManagers"),
SMS_Context_1("__ProviderArchitecture=32|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class PermittedManagers: SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String 1;
[SMS_Report(TRUE)] String 2;
[SMS_Report(TRUE)] String 3;
};

#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("PermittedManagers_64", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("PermittedManagers64"),SMS_Class_ID("PermittedManagers64"),
SMS_Context_1("__ProviderArchitecture=64|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class PermittedManagers_64 : SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String 1;
[SMS_Report(TRUE)] String 2;
[SMS_Report(TRUE)] String 3;
};

Reply via email to