Sealing management packs

When planning your customizations in Service Manager, one of the most important decisions to make is whether you are going to seal your Management packs or not.

As explained in Chapter 2, Personalizing SCSM 2016 Administration, a sealed management pack is a read-only management pack, which cannot be written to once it has been imported into Service Manager. Furthermore, sealing a management pack enables it to be referenced from within other management packs.

Some examples of when you need to reference another management pack are described here:

  • Creating an extension of a class: In this scenario, you create a reference to the management pack that holds the base class.
  • Customizing a form: This involves creating a reference to the management pack that defines the base form.
  • Creating a view: Normally, you would want to create your view through the console, which means you are going to save it in an unsealed management pack. This means that the class you are referencing in your view must be part of a sealed management pack.

Sealing management packs also ensures upgradeability. When you import a later version of a sealed management pack into Service Manager, Service Manager checks whether an upgrade is possible or not, and will reject non-upgradeable management packs. For instance, if you have your own custom class with a set of properties and decide that you do not want a couple of these properties anymore, and try to import a new version of the management pack where these properties have been removed - Service Manager would reject the import. In order to import this new version of the management pack you would actually have to delete the older version from the system first, which also would remove any instances of that class in the database.

As a general rule, always seal management packs that contain the following:

  • Classes
  • Class extensions
  • Forms
  • Form extensions

Getting ready

To seal a management pack, you need a Strong Name Key (SNK) file. You can use the sn.exe tool to create a new SNK file. This tool is part of the Service Manager Authoring Tool, but it can also be found in the Windows Software Development Kit (SDK), which can be downloaded from the following URL:

http://www.microsoft.com/en-us/download/details.aspx?id=8279

To create your own strong name key file, first check on your computer for the existence of the sn.exe tool. On computers running the Authoring Tool, sn.exe should be located in C:Program Files (x86)Microsoft SDKsWindowsv6.0Ain

If it isn't present there, you can try searching for it using this method:

  1. Click on Start, type cmd, and then press Enter.
  2. Type cd and press Enter.
  3. Type dir sn.exe /s and press Enter. This process will take a while and should output all locations where the sn.exe tool has been found. You can cancel the process with Ctrl-C once you find the tool. Write down the location of the sn.exe tool.

Creating the SNK file

Follow these steps to create your own SNK file:

  1. Click on Start, type cmd, and then right-click on cmd.exe. Click on Run as administrator. Click on Yes.
  2. Type cd <full Path to sn.exe directory> and press Enter.
  3. Type sn.exe -k <myfilename>.snk and press Enter, where <myfilename> is the name you want to give the file.
  4. Browse to the location and copy the SNK file to the directory where you store your Service Manager customizations.

    Creating the SNK file

Make sure that you keep a backup of this file and that you use this SNK for all your customizations.

How to do it...

Now that you know the concept of sealed management packs and have created your SNK file, we are going to show you how you can seal management packs using the Authoring Tool:

  1. Open the Authoring Tool, go to File, and then select Open. Browse to, and open the management pack that you want to seal (if you don't have such a management pack right now, you can create a new one just to try it out).
  2. Right-click on the management pack in Management Pack Explorer and click on Seal Management Pack.
  3. Change the Output Directory to the location where you would like to store your sealed management pack. Then, specify your SNK file and type the Company name.

    How to do it...

  4. Click on Seal, wait until the message Seal succeeded is displayed, and then click on Close.
  5. The management packs have now been sealed and can be imported to Service Manager.
  6. Remember that you now have two management packs - one editable file with the .XML file extension and one sealed management pack with the .MP file extension. Both files should be kept as you need to have the unsealed management pack if you would like to update it in the future.

    Tip

    Please note that the Authoring Tool automatically increases the version of the management pack every time you seal it.

There's more...

If you have to seal management packs often or would like to do it without using the Authoring Tool, we recommend you use FastSeal.exe.

FastSeal.exe

Instead of using the System Center 2016 Service Manager Authoring Tool for sealing your management packs, you can also use the FastSeal.exe command-line utility. This tool is very convenient if you need to seal management packs in bulk or if you want to automate the seal process.

You can download the FastSeal.exe utility from the following URL:

http://blogs.technet.com/b/servicemanager/archive/2009/12/25/sealing-management-packs.aspx.

To seal a management pack with FastSeal, you simply run this command:

FastSeal.exe ManagementPackToSeal.xml /Company YourCompany /KeyFile YourKeyfile.snk

See also

Refer to the following recipe for more information on how to work with management packs:

  • The Creating management packs to save your SCSM personalization recipe in Chapter 2Personalizing SCSM 2016 Administration
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.214.215