Showing results for 
Search instead for 
Did you mean: 

Feb Mission - Patching (Pesky) Servers

I approached it with the mindset of the schedule is going to change. Let's be honest though, it probably never will....right?

Joking aside, I created a Server Patching Schedule list that will hold the information for the servers that require patching along with an offset (in days) from the second Tuesday of each month (this way we can do some calculations later!).

From here, we can setup a site level workflow to create the items in a list and then make a calendar view.

The workflow

I created a site workflow so that the user can schedule it to run on any interval they wish.

Within the workflow, I am creating and using the following variables:

var_Today is defaulted to [Today] (which in the scenario will the 1st of the month).

We begin by adding 7 days to var_Today and then determine the day of the week by using a Build string action:

and then storing that into var_DayOfWeek.

Next we check to see if var_DayOfWeek is NOT EQUAL TO "Tuesday" using a For each action. We do this because if the 1st of the month is Tuesday, and then we add 7 days, that will land us on another Tuesday (which will be the second Tuesday of the month). If var_DayOfWeek is not equal to "Tuesday", we add 1 day to var_Today, recalculate var_DayOfWeek, and check again. We keep doing this until var_DayOfWeek is equal to "Tuesday". Now we have our second Tuesday of the month and can begin.

Before we start creating items, we need to use a Query list action to get all of the servers and their offset number. Doing this also allows for any additional servers that may be added over time or any changes to the offset.

Now that we have all the pieces, we can begin creating the items!

Using another For each action, we get the var_ServerName and var_OffsetNumber from our collections, do a date calculation by adding in the var_OffsetNumber to the var_Today date, and then create our item in the list.

Final Result

Ultimately the user needs a calendar within SharePoint to track all of the servers and when they require patching. I created a basic list for this for the eventuality that more data need to be collected. Such as server location, patch notes, who is schedule to perform the patch, who actually performed it, sign-off, etc. This list can be easily expanded and customized to accommodate any new information over the lifespan of the process.

Final Thoughts

I want to go back and see if I can make it so that it is not dependent on "the second Tuesday" of the month. What if that changes? This would require the workflow to be changed, and if we are promoting self-service, we need to think about that aspect as well.

Perhaps after inspireX I will pick this up and take a deeper look!

As always, hope this helps (provide some insight on how I think....)

Great mission ‌, look forward to what else there is to come!

Version history
Revision #:
1 of 1
Last update:
‎02-09-2017 11:00 AM
Updated by: