[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

After a management pack has been created by hand or loaded, it must be installed. If the management pack already exists, installing it again will update it as long as the management pack version is the same or a later version.

To load and install a management pack bundle

  1. Create the bundle from the bundle factory.

  2. Create a new bundle reader from the factory.

  3. Read the bundle file.

  4. Import the bundle through the management group.

The following example demonstrates how to load and install a management pack bundle.

C#  Copy Code
EnterpriseManagementGroup mg = new EnterpriseManagementGroup("localhost");
ManagementPackBundle bundle = ManagementPackBundleFactory.CreateBundle();
ManagementPackBundleReader bundleReader = ManagementPackBundleFactory.CreateBundleReader();
string bundleFile = @".\RePackaging.Library.mpb";

bundle = bundleReader.Read(bundleFile, mg);
mg.ManagementPacks.ImportBundle(bundle);

Namespaces

Microsoft.EnterpriseManagement

Microsoft.EnterpriseManagement.Packaging

Assemblies

Microsoft.EnterpriseManagement.Core

Microsoft.EnterpriseManagement.Packaging

To install a management pack object

  1. Call the ImportManagementPack method on the IManagementPackManagement object.

As long as you have access to a management pack object, regardless of how it was created, you can install it. The following example demonstrates how to install a management pack object.

C#  Copy Code
managementGroup.ManagementPacks.ImportManagementPack(managementPack);

Namespaces

Microsoft.EnterpriseManagement.Configuration

Microsoft.EnterpriseManagement

Microsoft.EnterpriseManagement.Packaging

Assemblies

Microsoft.EnterpriseManagement.Core

Microsoft.EnterpriseManagement.Packaging