This week I was working on another Service Manager customization and creating Management Pack bundles. Nothing special……well at least in my world
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:
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
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.
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.
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
$ManagementPack | export-SCManagementpack -targ $PWD
I have added the PowerShell scripts as attachment to this post.
Happy bundling or unbundling