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.

Output:

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.