Cleaning up Management Pack XML after SCSM Authoring Tool

For those of you working with System Center Service Manager (SCSM) and have created or edited forms in the Authoring Tool have probably noticed that Management Pack can easily become a couple of hundred rows! And that’s just the inside the <Forms> node!

This is happening due to the fact that the Authoring Tool is basically writing 3 lines of XML for every change you make. This includes changing values, moving controls etc.

There’s also some rumors that the excess amount of rows causes performance issues when loading the form in SCSM. It sounds reasonable to me, but I haven’t personally done any testing in this matter.

But fear not! The below script will remove the unnecessary XML!

I’ve included functionality for piping several XML-files, ie.

Get-ChildItem *.xml | Invoke-SCSMAuthoringToolCleanup

You can define where to save the processed XML with the parameter -OutputPath. If omitting this parameter the script will overwrite the existing Management Pack.

If you want the XML object as output for further processing, use the parameter -Passthru.

If you’re using fixed position and control sizes (which you shouldn’t!) you can omit processing of these nodes by setting the parameters -ProcessResize and -ProcessMove to $false.

You can download the script from TechNet Gallery at:
https://gallery.technet.microsoft.com/SCSM-Form-Customization-8ebe8dd7

Advertisements

2 thoughts on “Cleaning up Management Pack XML after SCSM Authoring Tool

  1. User

    Thanks for this, great idea. However, I can’t get the script to work – running it by any of your example methods just does nothing (no errors nor any messages on screen at all) as if the script is not actually running. Am I doing something wrong?

    Reply
    1. Daniel G Post author

      Per default the script does not have any output and makes the changes on the existing MP, in other words, no new file.

      If you want output you can use the -Verbose parameter.
      If you want a separate file use the -OutputPath parameter.

      Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s