Seal a Management Pack


Sealing a Management Pack is easy.  Although, it can be frustrating the first time through.  It’s a process that requires a few different pieces to interact, so preparation is key.  Going through some simple steps now will save time in the future.

  • Create a directory somewhere on a workstation where you’ll be sealing MP’s.  For this example, I created the directory c:\MPS
  • I also created four directories within c:\MPS
    • \Input – this directory will contain the MP to be sealed (the xml file)
    • \Output – this directory will contain the sealed MP (the final mp file)
    • \MP – this directory will contain all referenced MP’s
    • \Key – this directory will contain the pair key file
  • Copy MPSeal.exe from the installation media “SupportTools” directory to the c:\MPS directory.
  • Copy sn.exe to the c:\MPS directory
  • Copy your unsealed MP (xml file) into the \Input directory
  • Copy all the *.mp files from the RMS installation directory into the \MP directory
    • Usually “%Program Files%\System Center Operations Manager 2007\”
  • Also, copy all *.mp files that you’ll be referencing to the \MP directory
    • TIP: I’d just keep this directory updated with all available current MP’s (ie; Active Directory, Exchange, etc)

Finally, the c:\MPS directory will look like this.

image

The two files highlighted:
Command.txt is just a file I created that contains the commands needed to seal the management pack.  The MPResources.resources file is automatically created while sealing management packs.  This is not anything you’ll need to copy into the directory.

Now, we’re ready to seal our Management Pack.

Open a command prompt and navigate to your work directory (c:\MPS).  Run these commands in sequence.  (beware of word wrap with these commands)

  • sn -k c:\mps\key\PairKey.snk
  • sn -p c:\mps\key\PairKey.snk c:\mps\key\PubKey
  • sn -tp c:\mps\key\PubKey
  • mpseal c:\mps\input\unsealed_mp.xml /I “c:\mps\mp” /Keyfile “c:\mps\key\PairKey.snk” /Company “Your Company” /Outdir “c:\mps\output”

You should now have your sealed MP in the Output directory.  And, you’ll have a working directory for later use.  Just remember to keep the MP versions in the c:\MPS\MP directory current with your Management Groups.  Otherwise, you’ll get version errors while attempting to run the MPSeal tool.

Hint: Once you’ve created the key the first time around, it’s not necessary to create a new key each time you seal a MP.  The current key may be reused.  So, the only step you’ll need to actually do after the first run is the last step.  How’s that for easy!

A note to developers: I’ve had some questions about where the MPResources.resources file mentioned above is created.  Specifically, if two build flavor threads (x64 and x86, for example), compiles at same time and try to create this file under sources, one build thread will break.

To solve that problem, execute MPSeal from a different location.  Examples below.

This will create the MPResources.resources file in the users %temp% directory.clip_image002

This will create the MPResources.resources file in the x86 directory I created.clip_image004

This will create the MPResources.resources file in the x64 directory I created.clip_image006


Comments (27)

  1. Anonymous says:

    Sometimes customers need to create their own service monitor. This usually leads them to the Windows

  2. Anonymous says:

    Written by Mark Farrugia, Senior Microsoft Premier Field Engineer. In my previous post I started down

  3. Anonymous says:

    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  4. Anonymous says:

    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  5. Anonymous says:

    Feed: http://www.contoso.se Posted on: Tuesday, February 03, 2009 8:54 AM Author: Anders Bengtsson Subject:

  6. Anonymous says:

    Shortly after posting the sample Windows service monitoring library , I realized a “short”

  7. Anonymous says:

    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  8. Anonymous says:

    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  9. Anonymous says:

    Sometimes customers need to create their own service monitor. This usually leads them to the Windows

  10. Anonymous says:

    Let me just begin by saying : AAAaaaaaarrgh! Now I feel better. If you’ve made any attempt at implementing

  11. Hi Jonathan,

    Great tutorial, congratulations.

    Let me know, why can I copy Management Packs from SCOM instalation folder to other folder when I can referencing the original folder directly in command line? Example:

    mpseal c:mpsinput<unsealed_mp>.xml /I “c:mpsmp” /Keyfi

    e “c:mpskeyPairKey.snk” /Company “Your Company” /Outdir “c:mpsoutput”

    instead

    mpseal c:mpsinput<unsealed_mp>.xml /I “c:Program FilesSystem Center Operations Manager 2007” /Keyfi

    e “c:mpskeyPairKey.snk” /Company “Your Company” /Outdir “c:mpsoutput”

    This is my doubt.

    Tnx a lot.

    Cleber

    Response: The reason why I suggest creating these working directories, is because (1) not everyone will be sealing MP’s directly on the RMS and (2) you may not have all required MP references to seal a custom MP in the programs directory on the RMS.  If you are sealing an MP that contains, for example, an Active Directory reference, you’ll need to reference that MP while sealing your custom MP.  This will not be in RMS OpsMgr Program Files.  You’ll need to locate them.  Creating these working directories on a workstation in which you’ll be sealing MP’s is simply an organizational practice.

  12. Hi Vamsi,

    This is generated when running MPSeal, but I don’t know of a way to command the MPSeal program to create the MPResources.resources file in some other directory.

    -Jonathan

  13. Anonymous says:

    Sometimes customers need to create their own service monitor. This usually leads them to the Windows

  14. Anonymous says:

    I have had a few requests now for this, so I thought I would take the time to write up the process. &#160;

  15. Hi Vamsi,

    I figured out how and and where that MPResources.resources file is created.  I added some notes at the bottom of the post to answer your question.  It’s in "A note to developers".

    -Jonathan

  16. Anonymous says:

    Written by Mark Farrugia, Senior Microsoft Premier Field Engineer. In my previous post I started down

  17. You may also download the latest version of this file here: support.microsoft.com/…/2590414

  18. Anonymous says:

    After CU4, you will get the following error (see BR13's post):

    Error 1:

    : Could not load ManagementPack [ID=Microsoft.SystemCenter.Library, Keytoken=31b

    f3856ad364e35, Version=6.1.7221.61]. ManagementPack not found in the store.

    Cannot find MP File "Microsoft.SystemCenter.Library.mp" in any of the search dir

    ectories.

    This is because the version 6.1.7221.61 is not copied to the RMS installation folder, and therefore is not in your source directory. You need to manually edit the XML MP that you want to seal, and change the reference to the Microsoft.SystemCenter.Library.

    I suggest using XML Notepad to open the unsealed MP. Go to the Manifest section, then References, and select the appropriate Reference (Microsoft.SystemCenter.Library). Change the version number to 6.1.7221.0 instead of 6.1.7221.61.

  19. John_Curtiss says:

    I was having trouble with the second two "sn" commands crashing .NET 4.0 sn.exe on both a windows 8 and a windows 7 machine. found in another thread that I needed to copy snrc.dll into the same directory as sn.exe.

    stackoverflow.com/…/getting-issue-with-sn-exe-running-outside-the-netfx-4-0-tools

  20. Gopalan says:

    Great article. I just followed point by point and i am successful. Great work… thanks a lot.

    Gopalan (From India)

  21. Vamsi says:

    Can we redirect the temporary files to some directory? I mean, can I give temporary path where MPResources.resources should be created?

  22. dennis says:

    Good Stuff… Thanks for the information. It’s made my life with SCOM a lot better!

  23. Prabu Selvarajan says:

    Hi Jonathan,

    Excellent. The steps which you presented is working perfectly and its easy to follow up.

    Thanks a lot for helping many SCOM people who are eagerly look for this information.

    Regards,

    Prabu

  24. Tolga BALCI says:

    Hi Jonathan,

    Great work. Easy to follow and implement.

    Thank you a million times!

    Tolga

  25. Jake Stevens 2020 says:

    Hey Jonathan,

    Worked like a charm from start to finish! cheers

  26. BR13 says:

    I am getting error after following all these steps. Even though I have copied all mps from scom directory

    Could not load ManagementPack [ID=Microsoft.SystemCenter.Library, Keytoken=31bf3

    856ad364e35, Version=6.1.7221.61]. ManagementPack not found in the store.Cannot

    find MP File "Microsoft.SystemCenter.Library.mp" in any of the search directorie

    s.

  27. Anonymous says:

    Help! My company has written their own custom management pac …