Is it possible to provide a value in MOF file to overwrite that from CIMWin32 provider?

Marcus H 0 Reputation points
2023-02-01T04:33:56.24+00:00

Dear experts,

I want to overwrite a value in Win32BIOS . By default it is not possible , then I create/compile mine MOF file to generate a new Win32_BIOS class to provide the value in instance . The flaw is I can't fill other fields with real value.

Is it possible to derive from CIM_BIOSElement and fill values from CIMWin32 , but the specific field is overwrite with my value ?

Thanks

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,122 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Limitless Technology 43,931 Reputation points
    2023-02-02T10:18:24.9+00:00

    Hello there,

    Yes it is possile to provide values to MOF files.

    MOF files are usually automatically compiled during the installation of the systems with which they are provided, but you can also compile MOF files by using this tool.

    https://learn.microsoft.com/en-us/windows/win32/wmisdk/mofcomp

    It may not collect dynamic registry values using MOF, the MOF code is edited by SCCM, if we change the code that has been written, it maybe cause confusion. If the values are static, we could run some query to achieve it.

    Hope this resolves your Query !!

    --If the reply is helpful, please Upvote and Accept it as an answer–


  2. Marcus H 0 Reputation points
    2023-02-05T01:34:05.9433333+00:00

    I've created my MOF file and compiled , but don't know how to overwrite the value from CIMWin32.
    My experimental Mof file is like below , compilation succeed although Version value still inherits from CIMWin32 , other than my 999 :

    Managed Object FormatCopy

    
    #pragma namespace("\\\\.\\Root\\CIMv2")
    [Dynamic,Provider("CIMWin32") : ToInstance,Locale(1033) : ToInstance,UUID("{8502C4E1-5FBB-11D2-AAC1-006008C78BC7}") : ToInstance] 
    class Win32_BIOS : CIM_BIOSElement
    {
    [read , write ,key : ToSubclass,Override("Version") : ToSubclass] string Version="999";
    }
    
    
    0 comments No comments