31 Mar 2011

SCOM 2007 R2 How to unseal a management pack

There're lots of situations when you need to view the source code of discoveries/overrides/rules/monitors to troubleshoot your SCOM related issues in your production. Or maybe to change some parameters that are not overridable by default.





You can run the following powershell script to get the XML output of a sealed MP:

param($mpPath,$outputPath)
$assembly = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.OperationsManager")
$mp = new-object Microsoft.EnterpriseManagement.Configuration.ManagementPack($mpPath)
$mpWriter = new-object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackXmlWriter($outputPath)
$mpWriter.WriteManagementPack($mp)

You can "hardcode" the values in the script, but better, you should save this script to file(convert.ps1) and the example of execution:

c:\convert.ps1 -mppath 'c:\sealed.mp' -outputpath 'c:\'

2 comments:

  1. If you fall behind, run faster. Never give up, never surrender, and rise up against the odds. See the link below for more info.


    #run
    www.ufgop.org

    ReplyDelete

  2. I enjoy most of your articles,the articles are very informative for readers.

    Nersha
    www.gofastek.com

    ReplyDelete