Share via


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

  • Anonymous
    January 01, 2003
    Sometimes customers need to create their own service monitor. This usually leads them to the Windows

  • Anonymous
    January 01, 2003
    Written by Mark Farrugia, Senior Microsoft Premier Field Engineer. In my previous post I started down

  • Anonymous
    January 01, 2003
    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  • Anonymous
    January 01, 2003
    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  • Anonymous
    January 01, 2003
    Feed: www.contoso.se Posted on: Tuesday, February 03, 2009 8:54 AM Author: Anders Bengtsson Subject:

  • Anonymous
    January 01, 2003
    Shortly after posting the sample Windows service monitoring library , I realized a “short”

  • Anonymous
    January 01, 2003
    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  • Anonymous
    January 01, 2003
    Sometimes customers need to create their own Windows service monitors. This usually leads them to the

  • Anonymous
    January 01, 2003
    Sometimes customers need to create their own service monitor. This usually leads them to the Windows

  • Anonymous
    January 01, 2003
    Let me just begin by saying : AAAaaaaaarrgh! Now I feel better. If you’ve made any attempt at implementing

  • Anonymous
    January 01, 2003
    The comment has been removed

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    January 01, 2003
    Sometimes customers need to create their own service monitor. This usually leads them to the Windows

  • Anonymous
    January 01, 2003
    I have had a few requests now for this, so I thought I would take the time to write up the process.  

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    January 01, 2003
    Written by Mark Farrugia, Senior Microsoft Premier Field Engineer. In my previous post I started down

  • Anonymous
    January 01, 2003
    You may also download the latest version of this file here: support.microsoft.com/.../2590414

  • Anonymous
    January 01, 2003
    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.

  • Anonymous
    January 01, 2003
    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

  • Anonymous
    May 13, 2009
    Great article. I just followed point by point and i am successful. Great work... thanks a lot. Gopalan (From India)

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

  • Anonymous
    September 15, 2009
    Good Stuff... Thanks for the information. It's made my life with SCOM a lot better!

  • Anonymous
    June 10, 2010
    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

  • Anonymous
    July 09, 2010
    Hi Jonathan, Great work. Easy to follow and implement. Thank you a million times! Tolga

  • Anonymous
    February 10, 2011
    Hey Jonathan, Worked like a charm from start to finish! cheers

  • Anonymous
    May 11, 2011
    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.

  • Anonymous
    April 21, 2014
    Help! My company has written their own custom management pac ...