hey everyone..
I'm trying to make use of the very famous Mark Cochrane's RegKeytoMof however the following section fails during mof compilation.
Attached is the registry key collection MOF that I'm trying to import to Client Agent(Default Settings).
// RegKeyToMOF by Mark Cochrane (thanks to Skissinger, Steverac, Jonas Hettich & Kent Agerlund)
// this section tells the inventory agent what to report to the server
// 7/21/2014 2:12:01 PM
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("WarrantyInformation", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("WarrantyInformation"),SMS_Class_ID("WarrantyInformation"),
SMS_Context_1("__ProviderArchitecture=32|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class WarrantyInformation: SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String SerialNumber;
[SMS_Report(TRUE)] String ProductNumber;
[SMS_Report(TRUE)] String Status;
[SMS_Report(TRUE)] String ExpirationDate;
[SMS_Report(TRUE)] String Location;
};
#pragma namespace ("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("WarrantyInformation_64", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name("WarrantyInformation64"),SMS_Class_ID("WarrantyInformation64"),
SMS_Context_1("__ProviderArchitecture=64|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class WarrantyInformation_64 : SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] String SerialNumber;
[SMS_Report(TRUE)] String ProductNumber;
[SMS_Report(TRUE)] String Status;
[SMS_Report(TRUE)] String ExpirationDate;
[SMS_Report(TRUE)] String Location;
};
Mofcomp-check reports it alright.
C:\Warranty>mofcomp -check mofagentext.mof
Microsoft (R) MOF Compiler Version 6.3.9600.16384
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: mofagentext.mof
MOF file has been successfully parsed
Syntax check complete.
WARNING: File mofagentext.mof does not contain #PRAGMA AUTORECOVER.
If the WMI repository is rebuilt in the future, the contents of this MOF file wi
ll not be included in the new WMI repository.
To include this MOF file when the WMI Repository is automatically reconstructed,
place the #PRAGMA AUTORECOVER statement on the first line of the MOF file.
Done!
Compilation fails with the WBEM Code: 0X80041002.
C:\Warranty>mofcomp mofagentext.mof
Microsoft (R) MOF Compiler Version 6.3.9600.16384
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: mofagentext.mof
MOF file has been successfully parsed
Storing data in the repository...
An error occurred while creating object 2 defined on lines 10 - 18:
0X80041002 Class, instance, or property 'SMS_Class_Template' was not found.
Compiler returned error 0x80041002
C:\Warranty>
TIA.