Oct 3 2012

Creating Holiday and Business Hours in Lync 2010/2013 Response Groups

Posted by Brian Ricks at 8:22 AM
- Categories: 2010 | 2013 | Lync Server | Response Groups

How to create hour sets

It is a common question – I see in Lync Response Groups the option to use a pre-configured hour set but I don’t see an interface to create them…how do I add them to Response Groups? Creating pre-configured hours for Business Hours is convenient when creating multiple Response Groups and a requirement when you want to set Holiday Hours. The trick – Lync Management Shell is required.

Business Hours

The process is not difficult and requires limited skills to complete. We start by building a variable of dates and times and then apply the variable to a new Hours of Business or Holiday object.

If your business had hours of 8-5 Monday through Friday we would create the set as follows:

$weekday = New-CsRgsTimeRange -Name "Weekday Hours" -OpenTime "8:00" -CloseTime "17:00"

Again, this is simply the data set in our variable and has not actually created anything. Once this variable has been set we must use it to create the CsRgsHoursOfBusiness object. To create the object we would use the following command:

New-CsRgsHoursOfBusiness -Parent "service:ApplicationServer:lyncpool.domain.com" -Name "Business Hours" -MondayHours1 $weekday -TuesdayHours1 $weekday -WednesdayHours1 $weekday -ThursdayHours1 $weekday -FridayHours1 $weekday

As we can see, the options listed indicate the application pool where we are creating the object. The Name is the display name as we would see it when creating the Response Group; the MondayHours1, TuesdayHours1, etc. indicate the time block we are associating the previously defined variable. There is also a ‘2’ option for all days – helpful if your day is split such as open 8am – noon, closed for one hour, and then open from 1:00pm to 5:00pm.


The same concept is used for creating a holiday set. The main difference for the holiday set is that it most likely will be created per year – so managed as a yearly object. Again, we start with creating our variables. Assuming there are multiple holidays you are observing in a single year there will be multiple variable we set; as an example of 2012 US expanded bank holidays we would set the following:

$newyearsDay = New-CsRgsHoliday -StartDate "1/2/2012 12:00 AM" -EndDate "1/3/2012 12: 00 AM" -Name "New Year's Day"
$civilRightsDay = New-CsRgsHoliday -StartDate "1/16/2012 12:00 AM" -EndDate "1/17/2012 12:00 AM" -Name "Civil Rights Day "
$presidentsDay = New-CsRgsHoliday -StartDate "2/20/2012 12:00 AM" -EndDate "2/21/2012 12:00 AM" -Name "President's Day"
$memorialDay = New-CsRgsHoliday -StartDate "5/28/2012 12:00 AM" -EndDate "5/29/2012 12:00 AM" -Name "Memorial Day"
$independenceDay = New-CsRgsHoliday -StartDate "7/4/2012 12:00 AM" -EndDate "7/5/2012 12:00 AM" -Name "Independence Day"
$laborDay = New-CsRgsHoliday -StartDate "9/3/2012 12:00 AM" -EndDate "9/4/2012 12:00 AM" -Name "Labor Day"
$columbusDay = New-CsRgsHoliday -StartDate "10/8/2012 12:00 AM" -EndDate "10/9/2012 12:00 AM" -Name "Columbus Day"
$veteransDay = New-CsRgsHoliday -StartDate "11/12/2012 12:00 AM" -EndDate "11/13/2012 12:00 AM" -Name "Veteran's Day"
$thanksgivingDay = New-CsRgsHoliday -StartDate "11/22/2012 12:00 AM" -EndDate "11/24/2012 12:00 AM" -Name "Thanksgiving Day"
$christmasEve = New-CsRgsHoliday -StartDate "12/24/2012 12:00 AM" -EndDate "12/25/2012 12:00 AM" -Name "Christmas Eve"
$christmasDay = New-CsRgsHoliday -StartDate "12/25/2012 12:00 AM" -EndDate "12/26/2012 12:00 AM" -Name "Christmas Day"

The variable names set are completely arbitrary and up to you – as well as the duration of the holidays. You can add/adjust/modify as required for your business. The holiday set object is then created using these variables using the following command:

New-CsRgsHolidaySet -Parent "service:ApplicationServer:lyncpool.domain.com" -Name "2012 Holidays" -HolidayList($newyearsDay, $civilRightsDay, $presidentsDay, $memorialDay, $independenceDay, $laborDay, $columbusDay, $veteransDay, $thanksgivingDay, $christmasEve,  $christmasDay)

In this command you can see we are calling the variable previously set and adding them to the holiday set list named 2012 Holidays.

Modifying a Holiday Set

By creating the Business and Holiday sets we can now reference them when creating or modifying a Response Group. It also means, with a simply update to either set all Response Groups referencing the time and date sets take on the new schedule (preventing us from needing to update all Response Groups one-by-one which would be a tedious task if there were numerous Response Groups).

To modify a holiday set we would set a variable and then apply the variable to the holiday set. This is a multiple step process and starts with defining the variables.

$y = Get-CsRgsHolidaySet -Identity "service:ApplicationServer:lyncpool.domain.com"  -Name "2012 Holidays"
$newyearsEve = New-CsRgsHoliday -StartDate "12/31/2012 12:00 AM" -EndDate "1/1/2013 12: 00 AM" -Name "New Year's Eve"
Set-CsRgsHolidaySet -Instance $y

The first variable calls the Holiday Set in we wish to modify. The second variable defines the holiday times just as we did when we were creating the holiday set originally (in this case we decided to be closed the day before  New Years 2013 or December 31, 2012). We then build the command and commit it using the last two PowerShell statements.



Jonathan Trent

Jonathan Trent wrote on 10/15/12 10:03 AM

Thanks for posting this. It's a helpful way to address creating holiday and business hours.

MKallhoff wrote on 12/10/14 8:55 AM

very useful. added to my toolbox, thanks for sharing.

Write your comment

(it will not be displayed)

Leave this field empty:


Monthly Archives

Search Archives

Favorite Links