ConfigurationManager.ManagedObjectFormat 1.0.4

dotnet add package ConfigurationManager.ManagedObjectFormat --version 1.0.4
NuGet\Install-Package ConfigurationManager.ManagedObjectFormat -Version 1.0.4
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ConfigurationManager.ManagedObjectFormat" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ConfigurationManager.ManagedObjectFormat --version 1.0.4
#r "nuget: ConfigurationManager.ManagedObjectFormat, 1.0.4"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ConfigurationManager.ManagedObjectFormat as a Cake Addin
#addin nuget:?package=ConfigurationManager.ManagedObjectFormat&version=1.0.4

// Install ConfigurationManager.ManagedObjectFormat as a Cake Tool
#tool nuget:?package=ConfigurationManager.ManagedObjectFormat&version=1.0.4

ConfigurationManager.ManagedObjectFormat

Summary:

Provides a simple interface to extend and manage ConfigMgr's Hardware Inventory MOF Schema.

Usage:

///////////////////////////////////////////////////////////////////////////////////////////////////////////

//Define Inventory Extension
Extension inventoryExtension = new InventoryExtension()
{
    SMSClassID   = "MICROSOFT|PMPC_USERAPPS|1.0",
    ClassName    = "PMPC_UserApps",
    SMSGroupName = "PMPC UserApps",
    Namespace    =  "\\\\\\\\.\\\\root\\\\cimv2"
    Properties   = new Dictionary<string, int>
    {
        {"InstallLocation", 8}
        {"DisplayName", 8}
        {"DisplayVersion", 8}
        {"QuietUninstallString", 8}
        {"UninstallString", 8}
        {"Publisher", 8}
        {"InstallDate", 8}
        {"User" 8}
    }
};

//or use schema class to populate Extension Collection
Extension[] inventoryExtensions = Schema.GetFromJson("pathToJson")

///////////////////////////////////////////////////////////////////////////////////////////////////////////

ConnectionOptions options = new ConnectionOptions();
ManagementScope scope = new ManagementScope($@"\\{smsProviderServer}\ROOT\SMS\site_{siteCode}", options);

///////////////////////////////////////////////////////////////////////////////////////////////////////////

foreach ( Extension inventoryExtension in inventoryExtensions )
{
  //Install
  inventoryExtension.Install(scope)  
  //Enable
  inventoryExtension.Enable(scope);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////

Schema Class

Methods

  • GetFromJson(path) : Returns a collection of Extensions defined in the json.

Extension Class

Methods

  • Install(scope) : Installs / updates a custom class in the Hardware Inventory Schema.
  • Uninstall(scope): Removes Extension from Hardware Inventory Schema. Deletes related data from database.
  • Enable(scope): Enables the class for reporting on default client settings.
  • Disable(scope): Disables the class for reporting on default client settings.

Method Arguments

All Methods must be provided the ManagementScope Object. This is the Management Path to the SMS Provider Servers WMI Namespace

//define connection options if required
ConnectionOptions options = new ConnectionOptions();
ManagementScope scope     = new ManagementScope($@"\\{smsProviderServer}\ROOT\SMS\site_{siteCode}", options);

Properties

  • (String) SMSClassID: The Class ID that will be used to generate the database table, view, and the UI SDK class.
  • (String) ClassName: The name of the WMI Class.
  • (String) SMSGroupName: The name displayed in the Resource Explorer and Hardware Inventory UI.
  • (String) Namespace: The WMI namespace
  • (Dictionarty<string,int>) Properties: Dictionary of properties belonging to the WMI Class to be inventoried. The first property in the dictionary will be used as the key in database table. The int defines the CIM type of the property. See list of Type codes:
Value CIM Type
8 String
11 Boolean
13 Object
18 Uint16
19 Uint32
101 DateTime
8200 String[]
1210 Uint16[]

Requirements

  • System.Management (Nuget Package)
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.4 335 12/20/2023
1.0.3 378 10/31/2023
1.0.2 331 10/31/2023
1.0.1 343 10/30/2023
1.0.0 296 10/30/2023