Exporting Management Packs

Customers have asked if you can see what is inside sealed management packs. The UI actually prevents this, but it is possible to do via the command shell. In both cases, you need to find the management pack you want to export through whatever method you prefer and then export it as below:

Command Shell Example:

Get-ManagementPack -Name "Microsoft.SystemCenter.2007" | Export-ManagementPack -Path "C:\"

SDK Example:

 using System;
using System.Collections.ObjectModel;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Configuration;
using Microsoft.EnterpriseManagement.Configuration.IO;

namespace Jakub_WorkSamples
{
    partial class Program
    {
        static void ExportManagementPack()
        {
            // Connect to the local management group
            ManagementGroup mg = new ManagementGroup("localhost");

            // Get any management pack you want
            ManagementPack managementPack = 
                mg.GetManagementPack("Microsoft.SystemCenter.2007", "31bf3856ad364e35", new Version("6.0.5000.0"));
            
            // Provide the directory you want the file created in
            ManagementPackXmlWriter xmlWriter = new ManagementPackXmlWriter(@"C:\");
            xmlWriter.WriteManagementPack(managementPack);
        }
    }
}