Management Pack Bundles to bundle and to unbundle–Create a MPB and extract contents from a MPB

This week I was working on another Service Manager customization and creating Management Pack bundles. Nothing special……well at least in my world Winking smile

First a short intro to the management pack bundle, although this option has been around for a while now in Service Manager 2010 it will now also be available in Operations Manager 2012!

So if you want  a nice overview on Management Pack bundles take a look at the Service Manager documentation and examples.

A management pack bundle gives you the ability to not only add the XML but you could also add images or assembly in a much more efficient way then before without the bundle. When importing a MPB the xml will be imported as well as the assembly and images within it.

For more reading on the bundles:

http://technet.microsoft.com/en-us/library/ff461230.aspx

 http://blogs.technet.com/b/servicemanager/archive/2009/09/04/introducing-management-pack-bundles.aspx

A “management pack bundle” is really a MSI file with a file extension of .mpb (I should tell you that these .msi’s aren’t installable, we’re just using MSI as a file format). These bundles can be imported into Service Manager as a whole through a new MP import interface on the Data Access Service. You can import .mpb files via either the Management Packs view in the Administration workspace in the Service Manager console or using the Import-SCSMManagementPack PowerShell cmdlet (available in Beta 2). After import, the resources are automatically distributed to the appropriate places.

Apart from the above is based on service Manager the same goes for Operations Manager 2012!

 

Creating a bundle

Again as with service manager the way for creating bundle is exactly the same.

You will need to use the PowerShell script NEW-MPBFile.ps1 –

Place the xml or MP of your management pack in the same directory as your sources or images you want to bundle together together with the PowerShell script NEW-MPBFILE.ps1

image

Now simply open a powershell command and run the command

New.mpbfile.ps1 <MP name can be xml or mp or sealed or unsealed>

Next run the file as below and you will end up with a MPB file! Ready to be imported.

image

 

Extracting a bundle

For service manager many cmdlets have been created and put on codeplex to use PowerShell with Service Manager – http://smlets.codeplex.com/

Install the commandlets and open PowerShell and load the module by running the command “Import-Module SMLets”.

Next you can run the command export-bundlecontents

For a how to use the get-help command.

image

This commandlet will extract the resource files (dll as well as images!) and MPs.

***Note although this script works exactly the some on Operations Manager 2012 you need to adjust the script in one line.

Replace export-scsmmanagementpack with export-scmanagementpack:

 

$ManagementPack | export-SCSMManagementpack -targ $PWD

change into:

$ManagementPack | export-SCManagementpack -targ $PWD

 

I have added the PowerShell scripts as attachment to this post.

Happy bundling or unbundling Winking smile

3 thoughts on “Management Pack Bundles to bundle and to unbundle&ndash;Create a MPB and extract contents from a MPB

  1. ramdass

    Hi,

    Very good blog post. I’m interested in this from a SCOM 2012 perspective. Particularly, I’m interested in bundling assemblies and executables (*.dll and *.exe) files which contain SDK client code which works with my management pack. I’m interested to find out how to:

    1. Add them to my management pack xml as resources
    2. Reference them in other parts of my management packs
    3. Make it such that these assemblies can be failed over together with my management packs to another management server in the management server pool in SCOM 2012.

    Any help along those lines would be extremely helpful to me.

    Thanks a lot!

    Cheers,
    Dennis

  2. manoj

    Hi

    i am trying to  bundle xml, mp, and dll by file using windows power shell but i am getting error ” A positional parameter cannot be found that accepts argument ‘C:\>New-ServiceRequestBICustumReport’.
    At line:1 char:1
    + PS C:\>New-ServiceRequestBICustumReport -Name $mpbPath -ManagementPack $mp1, $mp .”

    Step in Power shell:

    PS C:\Users\suresh.pillai\Desktop\24NovBundle> $mpbPath = “C:\Users\suresh.pillai\Desktop\24NovBundle\ServiceRequestBICu
    stumReport.mpb”
    PS C:\Users\suresh.pillai\Desktop\24NovBundle> $mp1 = “C:\Users\suresh.pillai\Desktop\24NovBundle\ServiceRequestBICustum
    Report.mp”
    PS C:\Users\suresh.pillai\Desktop\24NovBundle> $mp2 = “C:\Users\suresh.pillai\Desktop\24NovBundle\ServiceRequestBICustum
    Report.xml”
    PS C:\Users\suresh.pillai\Desktop\24NovBundle> $r1 = “C:\Users\suresh.pillai\Desktop\24NovBundle\Microsoft.EnterpriseMan
    agement.ServiceManager.Applications.ServiceRequest.Forms.dll”
    PS C:\Users\suresh.pillai\Desktop\24NovBundle> PS C:\>New-ServiceRequestBICustumReport -Name $mpbPath -ManagementPack $m
    p1, $mp2 -Resource $r1
    Get-Process : A positional parameter cannot be found that accepts argument ‘C:\>New-ServiceRequestBICustumReport’.
    At line:1 char:1
    + PS C:\>New-ServiceRequestBICustumReport -Name $mpbPath -ManagementPack $mp1, $mp …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Get-Process], ParameterBindingException
    + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.GetProcessCommand

    please help on this.

    Thanks

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.