How to Install a Management Pack
Applies To: System Center Service Manager 2010
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
Create the bundle from the bundle factory.
Create a new bundle reader from the factory.
Read the bundle file.
Import the bundle through the management group.
The following example demonstrates how to load and install a management pack bundle.
EnterpriseManagementGroup mg = new EnterpriseManagementGroup("localhost");
ManagementPackBundle bundle;
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
- 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.
managementGroup.ManagementPacks.ImportManagementPack(managementPack);
Namespaces
Microsoft.EnterpriseManagement.Configuration
Microsoft.EnterpriseManagement
Microsoft.EnterpriseManagement.Packaging
Assemblies
Microsoft.EnterpriseManagement.Core
Microsoft.EnterpriseManagement.Packaging