Adding UK holidays to a Service Manager calendar

2017-12-01T11:24:36+00:00 March 4th, 2015|Exchange|

For sometime now Microsoft have had a blog entry on the Service Manager blog for adding holidays to a SCSM calendar and walks you through the steps on how to create this. This works really well and saves a huge amount of time. However, I have found myself having to keep recreating this each time I complete a new install for a customer and so to save myself even more time I have attached the CSV required for the UK and have removed the unnecessary entries such as ‘Battle of the Boyne’ etc. The problem with this is that the CSV (attached here) also contains the unique GUID for the SCSM calendar from the environment I created it from. You will need to update this GUID within the CSV otherwise when you import it you will end up with a new calendar that does not work. It’s the first column in the CSV file holds the calendar and the easiest way to update this  is to get the ID of your calendar and use the replace function of notepad (or your XML editor of choice). To get the ID (a high level overview):

  1. Using PowerShell import the module SMLets
  2. Get the Calendar object using the ‘Get-Object’ command specify the calendar class.
  3. Use the format list command to expose the ID

To get the ID (with a bit more detail):

  1. You will need to import the SMLets PowerShell commandlets using “Import-Module SMLets”
  2. To get the calendar run the command “Get-SCSMObject -Class (Get-SCSMClass -Name “System.Calendar$”) | fl”
  3. Copy the ID attribute including the “SLACalendar_”SCSM Calander
  4. Using Notepad do a find and replace to replace the existing calendar with the one you just found with the PowerShell command.
  5. Use the XML file provided by the Microsoft blog post and the CSV file you just updated.

There you have it a really quick way to populate the holidays into an existing SCSM calendar 🙂