How to Install a Management Pack
Updated: April 25, 2012
Applies To: System Center 2012 - Service Manager
After a management pack has been created by hand or loaded, it must be installed for use. If a previous version of the management pack is already installed, you can update it by installing the same or later version of the management pack. If the management pack refers to resources, those resources can be imported together with the management pack. For more information about importing management packs with resources, see How to Install a Management Pack with Resources
To install a management pack
Use an instance of the EnterpriseManagementGroup to call the ImportManagementPack method and pass in the management pack you want to install or update.
To load and install a management pack bundle
Create a new instance of the EnterpriseManagementGroup class to connect to a management server.
To get an instance of the ManagementPackBundleReader class, call the CreateBundleReader method.
Call the Read method. When you do this, supply the file name of the bundle and an instance of the EnterpriseManagementGroup class. This will return you an instance of the ManagementPackBundle class.
Use your existing EnterpriseManagementGroup instance to call the ImportBundle method.
Example
The following example imports a management pack instance.
managementGroup.ManagementPacks.ImportManagementPack(managementPack);
The following example imports 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);
Compiling the Code
Namespaces
Microsoft.EnterpriseManagement |
Microsoft.EnterpriseManagement.Packaging |
Microsoft.EnterpriseManagement.Configuration |
Assemblies
Microsoft.EnterpriseManagement.Core |