I'm trying to build a report on Windows 7 machines and their System Protection
status. I've found the registry key that controls if System Protection is on
and what it's set it. The problem is that the name of the key is
{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513} and mofcomp gets cranky about the { }.
I've tried using ^{ to escape the { as this article,
http://support.microsoft.com/kb/2543399, advises but it hasn't made any
difference yet.
Here's what I'm trying with the ^ in addition to what RegKeyToMof gave me:
Sms_def
// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich
& Kent Agerlund)
// this section tells the inventory agent what to report to the server
// 11/5/2013 8:32:46 AM
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("SystemProtection", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("SystemProtection"),SMS_Class_ID("Custom|SystemProtection|1.0"),
SMS_Context_1("__ProviderArchitecture=32|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class SystemProtection: SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String ^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^}^[^];
};
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("SystemProtection_64", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("SystemProtection"),SMS_Class_ID("Custom|SystemProtection|1.0"),
SMS_Context_1("__ProviderArchitecture=64|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class SystemProtection_64 : SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String ^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^}^[^];
};
// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich
& Kent Agerlund)
// this section tells the inventory agent what to collect
// 11/5/2013 8:32:46 AM
#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("SystemProtection", NOFAIL)
[DYNPROPS]
Class SystemProtection
{
[key] string KeyName;
String ^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^}^[^];
};
[DYNPROPS]
Instance of SystemProtection
{
KeyName="RegKeyToMOF_32";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\SPP\\Clients|^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^}"),Dynamic,Provider("RegPropProv")]
^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^};
};
#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass("SystemProtection_64", NOFAIL)
[DYNPROPS]
Class SystemProtection_64
{
[key] string KeyName;
String ^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^}^[^];
};
[DYNPROPS]
Instance of SystemProtection_64
{
KeyName="RegKeyToMOF_64";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows
NT\\CurrentVersion\\SPP\\Clients|^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^}"),Dynamic,Provider("RegPropProv")]
^{09F7EDC5-294E-4180-AF6A-FB0E6A0E9513^};
};
When compiling sms_def I get the error sms_def.mof (5495): error SYNTAX
0X8004400c: Expected property or method name
Configruation.mof appears to compile without error but when I open it back up
after compiling the additions are gone.
Tom Aguero
Shared Services | Information Technology
900 N Garver Rd, Monroe, OH 45050
Phone: 800.834.8001
[email protected]<mailto:[email protected]>