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
- If you need a copy, the sn.exe utility comes with .NET Framework SDK
- 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.
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.
This will create the MPResources.resources file in the x86 directory I created.
This will create the MPResources.resources file in the x64 directory I created.
I’ll right away grab your rss as I can not find your e-mail subscription link or e-newsletter service. Do you have any? Kindly let me know so that I could subscribe. Thanks.
On scom 2012 where are the Sealed MPs which are installed during the setuup.
we have installed on E:\
Good Post.
question:
I run fastseal.exe to seal a distributed aplication i have made and import it to SCSM 2012. the problem is that i can´t see the service Components i service manager. i can se the components when i seal with mpseal.exe. why we now use fastseal.exe is because after we upgrade SCOM til SP1 rollup3 we got an error when we importing a mp sealed with mpseal.exe. a tips was to use fastseal.exe instead.. This is the error:
( Could not load file or assembly ‘file:///H:\SCOM-MP\Nya DA\MP\Sealade DA MP\SPV.DA.KAPAN.mp’ or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.)
Any ideas? Must i seal with mpseal.exe to se the service Components i SCSM?