«

»

Mar 28

Lync Holiday Sets for the USA

The below powershell code has all of the major and minor holidays for the United States through 2015. If your business isn’t closed on the minor holidays, then simply delete those variables in the New-CsRgsHolidaySet command. Replace <poolname> below with either the name of your pool or the name of your standard edition server.

$a = New-CsRgsHoliday -Name "New Year's Day" -StartDate "1/1/2011" -EndDate "1/2/2011"
$b = New-CsRgsHoliday -Name "Martin Luther King Jr. Day" -StartDate "1/17/2011" -EndDate "1/17/2011"
$c = New-CsRgsHoliday -Name "President's Day" -StartDate "2/21/2011" -EndDate "2/21/2011"
$d = New-CsRgsHoliday -Name "Memorial Day" -StartDate "5/30/2011" -EndDate "5/30/2011"
$e = New-CsRgsHoliday -Name "Independence Day" -StartDate "7/4/2011" -EndDate "7/4/2011"
$f = New-CsRgsHoliday -Name "Labor Day" -StartDate "9/5/2011" -EndDate "9/5/2011"
$g = New-CsRgsHoliday -Name "Columbus Day" -StartDate "10/10/2011" -EndDate "10/10/2011"
$h = New-CsRgsHoliday -Name "Veterans Day" -StartDate "11/11/2011" -EndDate "11/11/2011"
$i = New-CsRgsHoliday -Name "Thanksgiving Day" -StartDate "11/24/2011" -EndDate "11/24/2011"
$j = New-CsRgsHoliday -Name "Christmas Day" -StartDate "12/26/2011" -EndDate "12/26/2011"
New-CsRgsHolidaySet -Parent "service:ApplicationServer:<poolname>" -name "2011 US Holidays" - holidaylist ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j)

$a = New-CsRgsHoliday -Name “New Year’s Day” -StartDate “1/1/2013” -EndDate “1/2/2013”
$b = New-CsRgsHoliday -Name “Martin Luther King Jr. Day” -StartDate “1/21/2013” -EndDate “1/21/2013”
$c = New-CsRgsHoliday -Name “President’s Day” -StartDate “2/18/2013” -EndDate “2/18/2013”
$d = New-CsRgsHoliday -Name “Memorial Day” -StartDate “5/27/2013” -EndDate “5/27/2013”
$e = New-CsRgsHoliday -Name “Independence Day” -StartDate “7/4/2013” -EndDate “7/4/2013”
$f = New-CsRgsHoliday -Name “Labor Day” -StartDate “9/2/2013” -EndDate “9/2/2013”
$g = New-CsRgsHoliday -Name “Columbus Day” -StartDate “10/14/2013” -EndDate “10/14/2013”
$h = New-CsRgsHoliday -Name “Veterans Day” -StartDate “11/11/2013” -EndDate “11/11/2013”
$i = New-CsRgsHoliday -Name “Thanksgiving Day” -StartDate “11/28/2013” -EndDate “11/28/2013”
$j = New-CsRgsHoliday -Name “Christmas Day” -StartDate “12/25/2013” -EndDate “12/25/2013”
New-CsRgsHolidaySet -Parent “service:ApplicationServer:<poolname>” -name “2013 US Holidays” -holidaylist ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j)

$a = New-CsRgsHoliday -Name “New Year’s Day” -StartDate “1/1/2014” -EndDate “1/2/2014”
$b = New-CsRgsHoliday -Name “Martin Luther King Jr. Day” -StartDate “1/20/2014” -EndDate “1/20/2014”
$c = New-CsRgsHoliday -Name “President’s Day” -StartDate “2/17/2014” -EndDate “2/17/2014”
$d = New-CsRgsHoliday -Name “Memorial Day” -StartDate “5/26/2014” -EndDate “5/26/2014”
$e = New-CsRgsHoliday -Name “Independence Day” -StartDate “7/4/2014” -EndDate “7/4/2014”
$f = New-CsRgsHoliday -Name “Labor Day” -StartDate “9/1/2014” -EndDate “9/1/2014”
$g = New-CsRgsHoliday -Name “Columbus Day” -StartDate “10/13/2014” -EndDate “10/13/2014”
$h = New-CsRgsHoliday -Name “Veterans Day” -StartDate “11/11/2014” -EndDate “11/11/2014”
$i = New-CsRgsHoliday -Name “Thanksgiving Day” -StartDate “11/27/2014” -EndDate “11/27/2014”
$j = New-CsRgsHoliday -Name “Christmas Day” -StartDate “12/25/2014” -EndDate “12/25/2014”
New-CsRgsHolidaySet -Parent “service:ApplicationServer:<poolname>” -name “2014 US Holidays” -holidaylist ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j)

$a = New-CsRgsHoliday -Name “New Year’s Day” -StartDate “1/1/2015” -EndDate “1/2/2015”
$b = New-CsRgsHoliday -Name “Martin Luther King Jr. Day” -StartDate “1/19/2015” -EndDate “1/19/2015”
$c = New-CsRgsHoliday -Name “President’s Day” -StartDate “2/16/2015” -EndDate “2/16/2015”
$d = New-CsRgsHoliday -Name “Memorial Day” -StartDate “5/25/2015” -EndDate “5/25/2015”
$e = New-CsRgsHoliday -Name “Independence Day” -StartDate “7/4/2015” -EndDate “7/4/2015”
$f = New-CsRgsHoliday -Name “Labor Day” -StartDate “9/7/2015” -EndDate “9/7/2015”
$g = New-CsRgsHoliday -Name “Columbus Day” -StartDate “10/12/2015” -EndDate “10/12/2015”
$h = New-CsRgsHoliday -Name “Veterans Day” -StartDate “11/11/2015” -EndDate “11/11/2015”
$i = New-CsRgsHoliday -Name “Thanksgiving Day” -StartDate “11/26/2015” -EndDate “11/26/2015”
$j = New-CsRgsHoliday -Name “Christmas Day” -StartDate “12/25/2015” -EndDate “12/25/2015”

New-CsRgsHolidaySet -Parent “service:ApplicationServer:<poolname>” -name “2015 US Holidays” -holidaylist ($a,$b,$c,$d,$e,$f,$g,$h,$i,$j)

To apply these holiday sets to an existing Response Group Service, run the following for each year:

$HolidayHours = Get-CsRgsHolidaySet “service:ApplicationServer:<poolname>” -Name “<Name of Holiday Set>”

$y = Get-CsRgsWorkflow <poolname> -Name “<Name of Response Group>”

$y.HolidaySetIDList.Add($HolidayHours.Identity)

Set-CsRgsWorkflow -Instance $y

1 comment

  1. Pat Richard

    Careful with copying/pasting the above. The smart quotes don’t always translate correctly, and can leave you with code that will generate errors. Make sure you inspect it before you run it!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

%d bloggers like this: