OpsMgr 2012: How to unseal a management pack

Just started looking into SCOM 2012. Since I’m pretty much interested in management pack internals, the first thing I use to do with new ones is unsealing them. So I tried to use the well-known script written by Boris Yanushpolsky. Unfortunately, schema has been changed, so I’ve got following error messages for several MPs:
New-Object : Exception calling “.ctor” with “1” argument(s): “XSD verification failed for management pack.¬† [Line: 1, Position: 17]”
After quick investigation I have discovered that there are two nice snippets shipped with SCOM 2012, so it is easy to unseal an MP using Operations Manager Shell.

Here is the sample script:


$InDirFull = (Get-Item $InDir).FullName
$OutDirFull = (Get-Item $OutDir).FullName

$MPs = ls $InDirFull\* -include *.mp

foreach($mp in $MPs)
  $mpFileName = $InDirFull + "\" + $mp.Name
  "Reading " + $mpFileName
  $mpObj = Get-SCManagementPack -ManagementPackFile $mpFileName
  Export-SCManagementPack -ManagementPack $mpObj -Path $OutDirFull

Here are detailed instructions on how to use that:

  1. Download the script: UnsealMP2012.zip, unzip it somewhere;
  2. Put management packs you want to unseal into folder (for example: C:\MyMPs_Sealed)
  3. Create an empty folder for unsealed versions (for example: C:\MyMPs_UnSealed)
  4. Open Operations Manager (Power)Shell:
  5. Run the script:
     UnsealMP2012.ps1 C:\MyMPs_Sealed C:\MyMPs_UnSealed
  6. You’re done!
Update: There is also a GUI tool written by Tim McFadden. I haven’t tried it, but Kevin Holman recommends it.

This post is provided AS IS. No warranties. Use at your own risk.

Leave a Comment