Unable to import MOF file in SCCM

vijayaragavan Hariharan 1 Reputation point
2020-12-09T18:06:10.623+00:00

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;
};

Microsoft Configuration Manager
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Garth Jones 2,071 Reputation points
    2020-12-09T19:06:11.217+00:00

    Remove the "." from the class name.

    1 person found this answer helpful.
    0 comments No comments

  2. Sherry Kissinger 3,801 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.

    1 person found this answer helpful.
    0 comments No comments

  3. AllenLiu-MSFT 40,081 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.

    0 comments No comments