Service Manager powershell snippets

Merry x-mas! In today’s December calendar tips & trick I’m going to a post some useful powershell snippets for Service Manager. As we all know, the December 11th is the special day where the Bethlehem-powershell star outshined all the others. 

 

 

 

The scripts here is mostly for administrative purposes. They are of course provided “as-is” so feel free to expand/optimize/ include more error handling etc.

Create Management Pack

UPDATE: Script now works with different windows localization. Default language will now be set according to the console language user preference and not the windows locale

Unfortunately we are not as lucky as the SCOM guys to get their “Create management pack” interface. What SCSM is lacking here is the ability to create internal names and a more readable version number to new Management Packs created via Console. So if you don’t want your management pack to have a file name like ManagementPack.b89e1e6f33ac4e3abf85bb3d2a4466a7.xml  you can either edit the xml code and rename the file, or just create the Management Pack via powershell. I hope to one day create a new console task with the SCOM GUI, but until then this script should do fine.

I have set some default parameters for name convention inspiration.

Export Management Packs to folders

This script will export management packs into folders with default format: targetfolder\Management pack displayname\version number. E.g. C:\SCSM\Coretech – Incident – ListCustomizations\1.0.0.0\

Set parameters like StartsWith to only export your own management starting with “xxx” in the displayname (like your company prefix).

Output:

image image

Clone subscriptions

You can create copy of templates, but not subscriptions. Fortunately this can be done via powershell. This can be useful if you have the exact same type of subscription, but just need to change the recipients for example. The script is very basic, it’s just to give an idea how it can be done, feel free to expand. Notice that this will only work for “Updated” and “Created” subscriptions. You will need some modifcations to make it work for other types, e.g. relationship-subscriptions or periodic subscriptions.

I hope to dig up some more from my collection in the future, until then: HAPPY X-mAZ!

By | 2014-12-11T09:36:00+00:00 December 11th, 2014|Powershell, Service Manager (SCSM)|0 Comments

About the Author:

Morten Meisler

Consultant / Developer / Trainer

Key areas / products:

  • System Center Service Manager
  • System Center Operations Manager
  • Automation (System Center Orchestrator / Service Management Automation (SMA))
  • Development: C#.Net, Powershell, SQL, Web development / HTML5 (Javascript,jQuery,CSS,HTML, Wordpress etc.)

Leave A Comment