Remove the "." from the class name.
Unable to import MOF file in SCCM
Hello,
I have created mof file to extend the hardware inventory for populating the .net versions on all servers.
I used the RegtoMOF tool and generated the mof file.
I tried to import the file but it throws an error, unable to compile the file.
Parsing MOF file: Framework.mof
Framework.mof (10): error SYNTAX 0X80044014: Unexpected character in class name
(must be an identifier)
Compiler returned error 0x80044014
Below is my code in the mof file
// RegKeyToMOF by Mark Cochrane (with help from Skissinger, SteveRac, Jonas Hettich, Kent Agerlund & Barker)
// this section tells the inventory agent what to report to the server
// 12/9/2020 9:29:18 AM
pragma namespace ("\\.\root\cimv2\SMS")
pragma deleteclass(".NETFramework", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name(".NETFramework"),SMS_Class_ID(".NETFramework"),
SMS_Context_1("__ProviderArchitecture=32|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class .NETFramework: SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] Uint32 Enable64Bit;
[SMS_Report(TRUE)] String InstallRoot;
[SMS_Report(TRUE)] Uint32 NGenTaskDelayStartAmount;
[SMS_Report(TRUE)] Uint32 NGenTaskDelayStart;
[SMS_Report(TRUE)] String DbgManagedDebugger;
[SMS_Report(TRUE)] Uint32 DbgJITDebugLaunchSetting;
};
pragma namespace ("\\.\root\cimv2\SMS")
pragma deleteclass(".NETFramework_64", NOFAIL)
[SMS_Report(TRUE),SMS_Group_Name(".NETFramework64"),SMS_Class_ID(".NETFramework64"),
SMS_Context_1("__ProviderArchitecture=64|uint32"),
SMS_Context_2("__RequiredArchitecture=true|boolean")]
Class .NETFramework_64 : SMS_Class_Template
{
[SMS_Report(TRUE),key] string KeyName;
[SMS_Report(TRUE)] Uint32 Enable64Bit;
[SMS_Report(TRUE)] String InstallRoot;
[SMS_Report(TRUE)] Uint32 NGenTaskDelayStartAmount;
[SMS_Report(TRUE)] Uint32 NGenTaskDelayStart;
[SMS_Report(TRUE)] String DbgManagedDebugger;
[SMS_Report(TRUE)] Uint32 DbgJITDebugLaunchSetting;
};
3 answers
Sort by: Most helpful
-
-
Sherry Kissinger 4,466 Reputation points
2020-12-10T16:17:44.217+00:00 fyi, this is the one I use... currently.
https://tcsmug.org/blogs/sherry-kissinger/422-dot-net-frameworks-mof-edit
It covers 1.0/1.1/2.0/3.0/3.5/4.<up to 8>
My next challenge is I haven't really thought much about .net Core, and /or .net framework 5.x So far... in my research of two whole computers... .net 5/core stuff doesn't go into the same regkeys like 3.5 or 4 does. So of course... likely it's a whole new ball game to figure that out.
-
AllenLiu-MSFT 43,951 Reputation points Microsoft Vendor
2020-12-10T07:21:08.237+00:00 @vijayaragavan Hariharan
Thank you for posting in Microsoft Q&A forum.
To get the .net version of all servers, you may check if below sql query helps:select distinct vrs.Name0 as Name, gsf.Name0 as DotNET from v_GS_SERVER_FEATURE gsf join v_R_System vrs on gsf.ResourceID = vrs.ResourceID where gsf.Name0 like '.Net framework _.% Features' and Operating_System_Name_and0 like '%server%' UNION ALL Select vrs.Name0 as Name, gis.ProductName0 as DotNET from v_GS_INSTALLED_SOFTWARE gis join v_R_System vrs on gis.ResourceID = vrs.ResourceID where gis.ProductName0 like 'Microsoft .Net framework _.% SDK' and Operating_System_Name_and0 like '%server%' Order by Name
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.