Saturday, January 7, 2012

Lync - Swedish Public Holidays (Svenska Helgdagar)

This is not really Specops Related, but hopefully someone will have some use of it and save a few minutes of time. :)
We are running a Microsoft Lync server as our Telephone solution and you have to manually specify the public holidays. I couldn't find any pre-written list/script for the Swedish Public Holidays so I wrote one myself with the help of this Blog Post. 

The Swedish Public Holidays for 2012 (Svenska Helgdagar 2012)

$a = New-CsRgsHoliday -Name "Nyårsdagen" -StartDate "2012-01-01" -EndDate "2012-01-02" 
$b = New-CsRgsHoliday -Name "Trettondagen" -StartDate "2012-01-06" -EndDate "2012-01-07" 
$c = New-CsRgsHoliday -Name "Långfredagen"-StartDate "2012-04-06" -EndDate "2012-04-07" 
$d = New-CsRgsHoliday -Name "Påskdagen"-StartDate "2012-04-08" -EndDate "2012-04-09" 
$e = New-CsRgsHoliday -Name "Annandag påsk"-StartDate "2012-04-09" -EndDate "2012-04-10" 
$f = New-CsRgsHoliday -Name "Första maj"-StartDate "2012-05-01" -EndDate "2012-05-02" 
$g = New-CsRgsHoliday -Name "Kristi himmelsfärdsdag"-StartDate "2012-05-17" -EndDate "2012-05-18" 
$h = New-CsRgsHoliday -Name "Pingstdagen"-StartDate "2012-05-27" -EndDate "2012-05-28" 
$i = New-CsRgsHoliday -Name "Sveriges nationaldag och svenska flaggans dag"    -StartDate "2012-06-01" -EndDate "2012-06-02" 
$j = New-CsRgsHoliday -Name "Midsommardagen"-StartDate "2012-06-23" -EndDate "2012-06-24" 
$k = New-CsRgsHoliday -Name "Alla helgons dag"-StartDate "2012-11-03" -EndDate "2012-11-04" 
$l = New-CsRgsHoliday -Name "Juldagen"-StartDate "2012-12-25" -EndDate "2012-12-26" 
$m = New-CsRgsHoliday -Name "Annandag jul"-StartDate "2012-12-26" -EndDate "2012-12-27" 
New-CsRgsHolidaySet -Parent "applicationserver:<your lync server name>" -name "2012 Holidays Sweden" -holidaylist ($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m)
#End of script 

And for 2013 (Svenska Helgdagar 2013)
$a = New-CsRgsHoliday -Name "Nyårsdagen" -StartDate "2013-01-01" -EndDate "2013-01-02" 
$b = New-CsRgsHoliday -Name "Trettondagen" -StartDate "2013-01-06" -EndDate "2013-01-07" 
$c = New-CsRgsHoliday -Name "Långfredagen"-StartDate "2013-03-29" -EndDate "2013-03-30" 
$d = New-CsRgsHoliday -Name "Påskdagen"-StartDate "2013-03-31" -EndDate "2013-04-01" 
$e = New-CsRgsHoliday -Name "Annandag påsk"-StartDate "2013-04-01" -EndDate "2013-04-02" 
$f = New-CsRgsHoliday -Name "Första maj"-StartDate "2013-05-01" -EndDate "2013-05-02" 
$g = New-CsRgsHoliday -Name "Kristi himmelsfärdsdag"-StartDate "2013-05-09" -EndDate "2013-05-10" 
$h = New-CsRgsHoliday -Name "Pingstdagen"-StartDate "2013-05-19" -EndDate "2013-05-20" 
$i = New-CsRgsHoliday -Name "Sveriges nationaldag och svenska flaggans dag"    -StartDate "2013-06-01" -EndDate "2013-06-02" 
$j = New-CsRgsHoliday -Name "Midsommardagen"-StartDate "2013-06-22" -EndDate "2013-06-23" 
$k = New-CsRgsHoliday -Name "Alla helgons dag"-StartDate "2013-11-02" -EndDate "2013-11-03" 
$l = New-CsRgsHoliday -Name "Juldagen"-StartDate "2013-12-25" -EndDate "2013-12-26" 
$m = New-CsRgsHoliday -Name "Annandag jul"-StartDate "2013-12-26" -EndDate "2013-12-27" 
New-CsRgsHolidaySet -Parent "applicationserver:<your lync server name>" -name "2013 Holidays Sweden" -holidaylist ($a, $b, $c, $d, $e, $f, $g, $h, $i, $j, $k, $l, $m)
#End of script 

Just copy and use those lines in the Lync Management Shell (and of course enter your own Lync Server Name) and you will then be able to use them in your Hunt and Response groups.

1 comment: