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\\

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


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!