How to Import a New Management Pack

Updated: January 31, 2012

Applies To: System Center 2012 - Operations Manager

You can use the Operations Manager class libraries to create and import a new management pack.


This example demonstrates how to import a new management pack for use in a management group. For information about creating management packs, see How to Create a Management Pack.

/// <summary>
/// Creates a new Management Pack by using the specified
///  identity elements.
/// </summary>
using System;
using System.Collections.Generic;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Configuration;
using Microsoft.EnterpriseManagement.Configuration.IO;
using System.Text;

namespace SDKSamples
	class Program
		static void Main(string[] args)
			ManagementGroup mg = new ManagementGroup("localhost");

			// Define the version of the Management Pack.
			string version = "";
			Version initialVersion = new Version(version);

			// Create a Management Pack store to indicate one or more directories where
			// referenced Management Packs are stored.
			ManagementPackFileStore mpStore = new ManagementPackFileStore();
			string directory = @"C:\Program Files\System Center Management Packs\";

			// Create the Management Pack.
			string mpName = "SampleMP";  // full name of the management pack.
			string friendlyName = "Test Management Pack 1";
			ManagementPack mp = 
				new ManagementPack(mpName, friendlyName, initialVersion, mpStore);

			// Import the Management Pack.

See Also