System Center 2012-Extended OIP “Scheduling OpsMgr Maintenance Mode in Exchange Calendar”

In my previous post I wrote about how to create an extended Integration pack for both OpsMgr and SCSM called System Center 2012-Extended OIP. I also showed you how to use the integration pack to deliver ad hoc maintenance mode from the SCSM Self Service Portal.

In this previous posting I promised to write a full blog how you could use an ordinary exchange calendar and schedule all your maintenance mode schedules in there. This blog will show you exactly this!

First of all sorry for the delay but blogging has been put a little to the background the last months since I was busy writing the authoring chapter for “System Center 2012 Operations Manager Unleashed”, fully called Chapter 22 “Authoring Management Packs and Reports”.

Never the less I think this post should definitely close the gap in OpsMgr 2012 around scheduling maintenance mode once and for all.

Some people asked why I didn’t make the start time available in the activity?

The answer to this is, if I recall correctly, there is no scheduling intelligence behind the start maintenance mode function. Although you can configure this by using the SDK it never knows when to start the maintenance since there is no schedule behind it watching when the start time occurs. Therefore the only option you have is start NOW.

Requirements

Before you can start with writing the runbook and implement the solution let’s sum up the integration packs used in this solution.

First of all here is a link for the official Microsoft Integration packs – Orchestrator Integration packs

And here the link to the wiki page containing both Microsoft and community packs – Wiki Orchestrator packs

The following integration packs are used:

Exchange Users Integration Pack for Orchestrator in System Center 2012 SP1

System Center 2012 Extended OIP  Download Latest version

All testing has been done on a System Center 2012 SP1 and should also just work on System Center 2012.

The first part of the runbook – “Check a shared Calendar”

First of all you need to create a Service Account which is email enabled and therefore has a calendar.

For this example I have created a service account : SVC_Maintenance

After creating the account you can grant permissions to people who are allowed to schedule maintenance mode.

Now we are ready to create our runbook.

image1

 

 

 

 

 

 

 

image2

 

 

 

 

 

 

 

image3

 

 

 

 

 

 

 

 

 

 

image4

 

 

 

 

 

 

image5

Wrap up of the first part

Monitor Date/Time Check for current Time every 5 minutes.
Format Date/Time Get current time + 5 minutes to gather 2 points in time with a 5 minute interval in between.
Get Item Connect to Exchange with  the configured service account and gather all appointments between 2 points in time from the Calendar.

 

Second part of the runbook – “Get group and set maintenance mode”

First a little warning (again)

Be aware with great POWER comes great RESPONSIBILITY!

Never ever put your Management Servers in Maintenance mode!! First there is no reason to and second all Management servers in Maintenance mode leaves no one to take them out anymore!

Like shutting the door with the ONLY  keys still inside!

Better to be safe than sorry

In the second part of the runbook you are going to use the System Center 2012 extended OIP to set the maintenance mode according to the information in the shared calendar we retrieved earlier.

Basically the second part of the runbook is the same as we created earlier but to fully describe the solution let’s configure the entire runbook.

image6

Now that’s all there is to it

Just turn on the runbook and create an appointment!

Since we are using the location of the appointment to gather the displayname of the group we want to put into maintenance you need to make sure the location matches exactly the displayname of your group. Just copy/paste it from your OpsMgr console when creating the appointment and that’s it!

image7

 

As soon as the workflow catches your appointment the workflow will query for the group based on the displayname and sends this information together with the duration of the maintenance mode to SCOM.

image8

 

 

Wrap Up

With this 4 step runbook you are now able to deliver REAL scheduled maintenance mode to your customers.

You can grant the key users access to this calendar to schedule their own maintenance or open up the calendar with read only to all users so they can track exactly when a server goes into maintenance mode!

Now for the people who want more automation, you can now combine this solution with the ability to schedule changes from SCSM!!!!

You can combine and extend this solution together with the solution Anders Bengtsson created.

http://contoso.se/blog/?p=3350&utm_source=rss&utm_medium=rss&utm_campaign=building-a-change-calendar-with-orchestrator-and-service-manager

With some orchestrator logic you should be able to easily retrieve the CI’s from the change and set them in maintenance mode exactly when the change will be deployed! Which combines SCSM – SCORCH – SCOM!

To be honest when you are using orchestrator in combination with the other System Center products you will soon discover the real power of System Center Magic!

Cheers,

Oskar Landman