Creating Scheduled Tasks with PowerShell

Creating scheduled tasks on servers is something I do on a regular basis when building new Skype for Business environments, and it’s always a pain to create them via the GUI.

To speed things up, I have the scheduled tasks I need to run declared as scripts which will automatically create the scheduled tasks for me whenever I spin up a new environment.

These are made possible by the ScheduledTasks module, which was introduced with PowerShell v4, which allows you to define New-ScheduledTaskAction objects, which are triggered by New-ScheduledTaskTrigger objects as part of a New-ScheduledTask, which is then Registered with Register-ScheduledTask.

For example:

First, define the action which the task will perform. In this case, I’m going to launch a non-interactive instance of PowerShell and fire a script.
$Action = New-ScheduledTaskAction -Execute 'C:Windows\System32\WindowsPowerShell\v1.0\powershell.exe' -Argument "-NonInteractive -NoLogo -NoProfile -File 'C:\scripts\do-something.ps1'"

Second, how should this be triggered? There are quite a few options here, such as hourly, daily, weekly, etc. A complicated example which runs every two weeks on a sunday at 3am:
$Trigger = New-ScheduledTaskTrigger -Weekly -WeeksInterval 2 -DaysOfWeek Sunday -at 3am
For more options on this cmdlet, check either get-help new-scheduledtasktrigger or technet

Third, combine the action and trigger to make a task
$Task = New-ScheduledTask -Action $Action -Trigger $Trigger -Settings (New-ScheduledTaskSettingsSet)

Finally, register the task and it’ll run the next time the trigger is fired
$Task | Register-ScheduledTask -TaskName "do-something every 2 weeks" -User 'administrator' -Password 'password in cleartext'

Further reading here: https://technet.microsoft.com/en-us/library/jj649816(v=wps.630).aspx

Advertisements

Backup your Server Roles and Features

Not just for Skype for Business – this powershell script gathers the installed components for any Windows server, allowing you to automate server run-ups for whatever you’re building. Excellent work!

Mark Vale Consulting Blog

The following short script gathers the installed roles and features on a server and outputs them to PowerShell script that can be used to redeploy them on another server. This can be useful during migration scenarios or when you need to deploy an additional server with the same requirements.

Copy the below code and save it as a ps1 file.

View original post 90 more words

Call Preannouncement for Lync and Skype for Business

One of my customers wants to have direct incoming calls to some individual users’ numbers to have an announcement played to warn the caller that the call may be recorded.

Before I go any further, I’ll make it quite clear that I have not deployed this to their environment, nor have I told them that it’s technically possible. It’s much much simpler to convince the customer to require all inbound calls to filter through an IVR before being routed to a response group or contact centre application where the agents receive the calls.

But the question was raised and I was curious if I could make it work. I do love a good thought experiment.

These steps should be repeated for each individual number which needs this. In this example, let’s say the user’s LineURI is +61399991234. I’ll also be using +61355501234, which is within a fictitious range in south-east Australia.

Step 1: Make an announcement and point it at the user’s number.

New-CsAnnouncement -Identity ApplicationServer:fepool.customer.local `
-Name "Pre0399991234" `
-AudioFilePrompt "WelcomeMessage.wav" `
-TargetUri "sip:+61399991234@customer.com;user=phone"

Step 2: Translate the user’s number when it enters from network

Option a: Translate just the one number

New-CsVoiceNormalizationRule -Parent Global `
-name 'Pre0399991234' `
-pattern '^0399991234$' `
-Translation '+61355501234' `
-Priority 0

Option b: Translate an entire number range, in this case 100

New-CsVoiceNormalizationRule -Parent Global `
-name 'Pre03999912xx' `
-pattern '^03999912(\d{2})$' `
-Translation '+613555012$1' `
-Priority 0

Step 3: Make an unassigned number range to tie the two together

New-CsUnassignedNumber -Identity 'Pre0399991234' `
-NumberRangeStart "+61355501234" `
-NumberRangeEnd "+61355501234" `
-AnnouncementService 'ApplicationServer:fepool.customer.local' `
-AnnouncementName "Pre0399991234"

On an incoming call, the number will be modified by the normalization rule, and the reverse number lookup will spot that it’s an unassigned number. It’ll play the announcement for that particular number, which will then change the target back to the user’s actual line URI.

Important notes

I’ve added the incoming number normalization rule to the Global dial plan – for my sites I tend to use User dial plans for the users, and leave the incoming normalization rules in the Global dial plan. If your environment uses Pool or Site dial plans, things will be slightly different due to the sequence the dial plans are checked on an incoming call.

When adding the normalization rules, I’ve set the priority as zero so that they’re added above all other entries. This means that further down the list I can have one which translates 03999912xx to +613999912xx for any users who don’t have this announcement system enabled.

While the normalization rule can encompass an entire range, I can’t see any way to compress the announcements or unassigned number ranges, as they must have a one-to-one mapping with the user’s real and fictitious numbers. This could be painful to set up, and even more painful to administer, so bear this in mind before agreeing to this admittedly out-of-the-norm solution.

Leigh.

Bulk enable Office 365 UM Mailboxes

This evening I came across an engineer who was trying to enable about 500 users for voicemail in the Office 365 portal by tediously clicking on each individual user, typing in their extension number, selecting a voicemail policy, etc. It would have taken him hours.

My first script was quick and dirty and got the job done with the help of some column editing and macros in Notepad++

Version 2 is a bit more refined. Export all your users from Lync or SfB like this:

get-csuser | ft sipaddress,lineuri > users.csv

Edit the csv with notepad++ to:

  • add a new line at the top with the content “upn,ext” to act as headers
  • remove the existing column headers
  • remove the sip: at the start of each upn
  • remove everything except the user’s extension
  • put a comma between the upns and extensions

Once you’re done, save it out and run this guy:

$mailboxes =  Import-CSV “users.csv”
FOREACH ($mailbox in $mailboxes) {
Enable-UMMailbox -Identity $Mailbox.upn -ummailboxpolicy “Office365UM Default Policy” -pin 131313 -pinexpired $true -Extensions $Mailbox.ext -NotifyEmail $Mailbox.upn
}

This will enable every user for voicemail and then send them an email to let them know their new PIN. Not super elegant, but it gets the job done.

 

Australian 2016 Response Group Holiday Sets

Like so many Skype for Business engineers, the holiday season is a time of wonder, family, and updating a multitude of holiday sets and response groups.

These sets are generated based on data from the Australian Government website, and are set to overlap slightly so you can run them now and they should see you through to NYE 2016.

Save to your environment as New-CsRgs2016Sets.ps1 and kick it off like this:

.\New-CsRgs2016Sets.ps1 -poolFQDN <your.frontend.pool>

You’ll then get a nice menu to list the existing sets you have in your system, delete the existing sets (All of them. Careful.), and to create the new 2016 sets. You can then jump in to your RgsConfig and tick the boxes you need for each response group, like this:

rgs

If you spot anything weird, please let me know.

Leigh.

# Response Group Holiday Sets Version 2016.1.0
# Created by Leigh Henderson
param (
    [string]$poolFQDN = $(throw "Error: -PoolFQDN is required.")
)

[int]$xMenuChoiceA = 0
while ( $xMenuChoiceA -lt 1 -or $xMenuChoiceA -gt 4 ){
Write-Host “`n`tResponse Group Holiday Sets Version 2016.1.0`n” -ForegroundColor Magenta
Write-Host “`t`tPlease select an option:`n” -Fore Cyan
Write-Host “`t`t`t1. List existing holiday sets” -Fore Cyan
Write-Host “`t`t`t2. Delete ALL existing holiday sets” -Fore Cyan
Write-Host “`t`t`t3. Create 2016 Holiday Sets” -Fore Cyan

[Int]$xMenuChoiceA = read-host "Please enter an option..." }
Switch( $xMenuChoiceA ){
  1{Write-Host "Current Holiday Sets:" -ForegroundColor Yellow
  get-csrgsholidayset | fl name,holidaylist
    }
  2{Write-Host "Deleting all existing holiday sets..." -ForegroundColor Yellow
  get-csrgsholidayset | Remove-CsRgsHolidaySet
    }

  3{Write-Host "Removing all existing response response group holiday sets..." -ForegroundColor Yellow

$ServiceId = "service:ApplicationServer:$poolFQDN"

$ACT2015a = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$ACT2015b = new-rgsholiday -startdate "12/26/2015 12:00:00 AM" -enddate "12/27/2015 12:00:00 AM" -name "Boxing Day"
$ACT2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Boxing Day holiday"
$ACT2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$ACT2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$ACT2016c = new-rgsholiday -startdate "03/14/2016 12:00:00 AM" -enddate "03/15/2016 12:00:00 AM" -name "Canberra Day"
$ACT2016d = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$ACT2016e = new-rgsholiday -startdate "03/26/2016 12:00:00 AM" -enddate "03/27/2016 12:00:00 AM" -name "Easter Saturday"
$ACT2016f = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$ACT2016g = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$ACT2016h = new-rgsholiday -startdate "06/13/2016 12:00:00 AM" -enddate "06/14/2016 12:00:00 AM" -name "Queen's Birthday"
$ACT2016i = new-rgsholiday -startdate "09/26/2016 12:00:00 AM" -enddate "09/27/2016 12:00:00 AM" -name "Family and Community Day"
$ACT2016j = new-rgsholiday -startdate "10/03/2016 12:00:00 AM" -enddate "10/04/2016 12:00:00 AM" -name "Labour Day"
$ACT2016k = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$ACT2016l = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Boxing Day"
$ACT2016m = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Christmas Day holiday"
$NSW2015a = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$NSW2015b = new-rgsholiday -startdate "12/26/2015 12:00:00 AM" -enddate "12/27/2015 12:00:00 AM" -name "Boxing Day"
$NSW2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Boxing Day holiday"
$NSW2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$NSW2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$NSW2016c = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$NSW2016d = new-rgsholiday -startdate "03/26/2016 12:00:00 AM" -enddate "03/27/2016 12:00:00 AM" -name "Easter Saturday"
$NSW2016e = new-rgsholiday -startdate "03/27/2016 12:00:00 AM" -enddate "03/28/2016 12:00:00 AM" -name "Easter Sunday"
$NSW2016f = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$NSW2016g = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$NSW2016h = new-rgsholiday -startdate "06/13/2016 12:00:00 AM" -enddate "06/14/2016 12:00:00 AM" -name "Queen's Birthday"
$NSW2016i = new-rgsholiday -startdate "10/03/2016 12:00:00 AM" -enddate "10/04/2016 12:00:00 AM" -name "Labour Day"
$NSW2016j = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$NSW2016k = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Boxing Day"
$NSW2016l = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Christmas Day holiday"
$NT2015a = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$NT2015b = new-rgsholiday -startdate "12/26/2015 12:00:00 AM" -enddate "12/27/2015 12:00:00 AM" -name "Boxing Day"
$NT2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Boxing Day holiday"
$NT2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$NT2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$NT2016c = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$NT2016d = new-rgsholiday -startdate "03/26/2016 12:00:00 AM" -enddate "03/27/2016 12:00:00 AM" -name "Easter Saturday"
$NT2016e = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$NT2016f = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$NT2016g = new-rgsholiday -startdate "06/13/2016 12:00:00 AM" -enddate "06/14/2016 12:00:00 AM" -name "Queen's Birthday"
$NT2016h = new-rgsholiday -startdate "08/01/2016 12:00:00 AM" -enddate "08/02/2016 12:00:00 AM" -name "Picnic Day"
$NT2016i = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$NT2016j = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Boxing Day"
$NT2016k = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Christmas Day holiday"
$QLD2015a = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$QLD2015b = new-rgsholiday -startdate "12/26/2015 12:00:00 AM" -enddate "12/27/2015 12:00:00 AM" -name "Boxing Day"
$QLD2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Boxing Day holiday"
$QLD2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$QLD2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$QLD2016c = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$QLD2016d = new-rgsholiday -startdate "03/26/2016 12:00:00 AM" -enddate "03/27/2016 12:00:00 AM" -name "Easter Saturday"
$QLD2016e = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$QLD2016f = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$QLD2016g = new-rgsholiday -startdate "05/02/2016 12:00:00 AM" -enddate "05/03/2016 12:00:00 AM" -name "Labour Day"
$QLD2016h = new-rgsholiday -startdate "10/03/2016 12:00:00 AM" -enddate "10/04/2016 12:00:00 AM" -name "Queen's Birthday"
$QLD2016i = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$QLD2016j = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Boxing Day"
$QLD2016k = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Christmas Day holiday"
$SA2015a = new-rgsholiday -startdate "12/24/2015 12:00:00 AM" -enddate "12/25/2015 12:00:00 AM" -name "Christmas Eve"
$SA2015b = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$SA2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Proclamation Day"
$SA2015d = new-rgsholiday -startdate "12/31/2015 12:00:00 AM" -enddate "01/01/2016 12:00:00 AM" -name "New Year's Eve"
$SA2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$SA2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$SA2016c = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$SA2016d = new-rgsholiday -startdate "03/26/2016 12:00:00 AM" -enddate "03/27/2016 12:00:00 AM" -name "Easter Saturday"
$SA2016e = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$SA2016f = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$SA2016g = new-rgsholiday -startdate "06/13/2016 12:00:00 AM" -enddate "06/14/2016 12:00:00 AM" -name "Queen's Birthday"
$SA2016h = new-rgsholiday -startdate "10/03/2016 12:00:00 AM" -enddate "10/04/2016 12:00:00 AM" -name "Labour Day"
$SA2016i = new-rgsholiday -startdate "12/24/2016 12:00:00 AM" -enddate "12/25/2016 12:00:00 AM" -name "Christmas Eve"
$SA2016j = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$SA2016k = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Christmas Day holiday"
$SA2016l = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Proclamation Day"
$SA2016m = new-rgsholiday -startdate "12/31/2016 12:00:00 AM" -enddate "01/01/2017 12:00:00 AM" -name "New Year's Eve"
$TAS2015a = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$TAS2015b = new-rgsholiday -startdate "12/26/2015 12:00:00 AM" -enddate "12/27/2015 12:00:00 AM" -name "Boxing Day"
$TAS2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Boxing Day holiday"
$TAS2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$TAS2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$TAS2016c = new-rgsholiday -startdate "03/14/2016 12:00:00 AM" -enddate "03/15/2016 12:00:00 AM" -name "Eight Hours Day"
$TAS2016d = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$TAS2016e = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$TAS2016f = new-rgsholiday -startdate "03/29/2016 12:00:00 AM" -enddate "03/30/2016 12:00:00 AM" -name "Easter Tuesday"
$TAS2016g = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$TAS2016h = new-rgsholiday -startdate "06/13/2016 12:00:00 AM" -enddate "06/14/2016 12:00:00 AM" -name "Queen's Birthday"
$TAS2016i = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$TAS2016j = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Boxing Day"
$TAS2016k = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Christmas Day holiday"
$VIC2015a = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$VIC2015b = new-rgsholiday -startdate "12/26/2015 12:00:00 AM" -enddate "12/27/2015 12:00:00 AM" -name "Boxing Day"
$VIC2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Boxing Day holiday"
$VIC2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$VIC2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$VIC2016c = new-rgsholiday -startdate "03/14/2016 12:00:00 AM" -enddate "03/15/2016 12:00:00 AM" -name "Labour Day"
$VIC2016d = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$VIC2016e = new-rgsholiday -startdate "03/26/2016 12:00:00 AM" -enddate "03/27/2016 12:00:00 AM" -name "Easter Saturday"
$VIC2016f = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$VIC2016g = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$VIC2016h = new-rgsholiday -startdate "06/13/2016 12:00:00 AM" -enddate "06/14/2016 12:00:00 AM" -name "Queen's Birthday"
$VIC2016i = new-rgsholiday -startdate "11/01/2016 12:00:00 AM" -enddate "11/02/2016 12:00:00 AM" -name "Melbourne Cup"
$VIC2016j = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$VIC2016k = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Boxing Day"
$VIC2016l = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Christmas Day holiday"
$WA2015a = new-rgsholiday -startdate "12/25/2015 12:00:00 AM" -enddate "12/26/2015 12:00:00 AM" -name "Christmas Day"
$WA2015b = new-rgsholiday -startdate "12/26/2015 12:00:00 AM" -enddate "12/27/2015 12:00:00 AM" -name "Boxing Day"
$WA2015c = new-rgsholiday -startdate "12/28/2015 12:00:00 AM" -enddate "12/29/2015 12:00:00 AM" -name "Boxing Day holiday"
$WA2016a = new-rgsholiday -startdate "01/01/2016 12:00:00 AM" -enddate "01/02/2016 12:00:00 AM" -name "New Year's Day"
$WA2016b = new-rgsholiday -startdate "01/26/2016 12:00:00 AM" -enddate "01/27/2016 12:00:00 AM" -name "Australia Day"
$WA2016c = new-rgsholiday -startdate "03/07/2016 12:00:00 AM" -enddate "03/08/2016 12:00:00 AM" -name "Labour Day"
$WA2016d = new-rgsholiday -startdate "03/25/2016 12:00:00 AM" -enddate "03/26/2016 12:00:00 AM" -name "Good Friday"
$WA2016e = new-rgsholiday -startdate "03/28/2016 12:00:00 AM" -enddate "03/29/2016 12:00:00 AM" -name "Easter Monday"
$WA2016f = new-rgsholiday -startdate "04/25/2016 12:00:00 AM" -enddate "04/26/2016 12:00:00 AM" -name "Anzac Day"
$WA2016g = new-rgsholiday -startdate "06/06/2016 12:00:00 AM" -enddate "06/07/2016 12:00:00 AM" -name "Western Australia Day"
$WA2016h = new-rgsholiday -startdate "09/26/2016 12:00:00 AM" -enddate "09/27/2016 12:00:00 AM" -name "Queen's Birthday"
$WA2016i = new-rgsholiday -startdate "12/25/2016 12:00:00 AM" -enddate "12/26/2016 12:00:00 AM" -name "Christmas Day"
$WA2016j = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Boxing Day"
$WA2016k = new-rgsholiday -startdate "12/26/2016 12:00:00 AM" -enddate "12/27/2016 12:00:00 AM" -name "Christmas Day holiday"
$WA2016l = new-rgsholiday -startdate "12/27/2016 12:00:00 AM" -enddate "12/28/2016 12:00:00 AM" -name "Boxing Day holiday"

new-csrgsholidayset -Parent $serviceid -Name "ACT Public Holidays 2016" -HolidayList(
$ACT2015a,
$ACT2015b,
$ACT2015c,
$ACT2016a,
$ACT2016b,
$ACT2016c,
$ACT2016d,
$ACT2016e,
$ACT2016f,
$ACT2016g,
$ACT2016h,
$ACT2016i,
$ACT2016j,
$ACT2016k,
$ACT2016l,
$ACT2016m

)
new-csrgsholidayset -Parent $serviceid -Name "NSW Public Holidays 2016" -HolidayList(

$NSW2015a,
$NSW2015b,
$NSW2015c,
$NSW2016a,
$NSW2016b,
$NSW2016c,
$NSW2016d,
$NSW2016e,
$NSW2016f,
$NSW2016g,
$NSW2016h,
$NSW2016i,
$NSW2016j,
$NSW2016k,
$NSW2016l

)
new-csrgsholidayset -Parent $serviceid -Name "NT Public Holidays 2016" -HolidayList(

$NT2015a, 
$NT2015b, 
$NT2015c,
$NT2016a, 
$NT2016b, 
$NT2016c, 
$NT2016d, 
$NT2016e, 
$NT2016f, 
$NT2016g, 
$NT2016h, 
$NT2016i, 
$NT2016j, 
$NT2016k

)
new-csrgsholidayset -Parent $serviceid -Name "QLD Public Holidays 2016" -HolidayList(

$QLD2015a,
$QLD2015b,
$QLD2015c,
$QLD2016a,
$QLD2016b,
$QLD2016c,
$QLD2016d,
$QLD2016e,
$QLD2016f,
$QLD2016g,
$QLD2016h,
$QLD2016i,
$QLD2016j,
$QLD2016k

)
new-csrgsholidayset -Parent $serviceid -Name "SA Public Holidays 2016" -HolidayList(

$SA2015a, 
$SA2015b, 
$SA2015c, 
$SA2015d,
$SA2016a, 
$SA2016b, 
$SA2016c, 
$SA2016d, 
$SA2016e, 
$SA2016f, 
$SA2016g, 
$SA2016h, 
$SA2016i, 
$SA2016j, 
$SA2016k, 
$SA2016l, 
$SA2016m

)
new-csrgsholidayset -Parent $serviceid -Name "TAS Public Holidays 2016" -HolidayList(

$TAS2015a,
$TAS2015b,
$TAS2015c,
$TAS2016a,
$TAS2016b,
$TAS2016c,
$TAS2016d,
$TAS2016e,
$TAS2016f,
$TAS2016g,
$TAS2016h,
$TAS2016i,
$TAS2016j,
$TAS2016k

)
new-csrgsholidayset -Parent $serviceid -Name "VIC Public Holidays 2016" -HolidayList(

$VIC2015a,
$VIC2015b,
$VIC2015c,
$VIC2016a,
$VIC2016b,
$VIC2016c,
$VIC2016d,
$VIC2016e,
$VIC2016f,
$VIC2016g,
$VIC2016h,
$VIC2016i,
$VIC2016j,
$VIC2016k,
$VIC2016l

)
new-csrgsholidayset -Parent $serviceid -Name "WA Public Holidays 2016" -HolidayList(

$WA2015a, 
$WA2015b, 
$WA2015c,
$WA2016a, 
$WA2016b, 
$WA2016c, 
$WA2016d, 
$WA2016e, 
$WA2016f, 
$WA2016g, 
$WA2016h, 
$WA2016i, 
$WA2016j, 
$WA2016k, 
$WA2016l
)

}
}

Migrating to a new Lync 2013 pool – Preamble

We recently decided to decommission one of our datacentres, as the hardware there was getting old and the service we were getting wasn’t that spectacular. Most of the machines there were fairly old, too, so it gave us a good excuse to rebuild our aging AD servers as 2012R2, for example.

The only newish gear in that datacentre is our internal Lync 2013 pool, which was built just after Lync 2013 was released. As a result, the machines are running Windows 2012, and there are only two Frontend servers – we built it with the old recommended layout and never quite got around to building a third frontend (ever seen a builder’s house?).

Instead of migrating, I figured it would be a good opportunity to rebuild the servers on 2012R2 in the new datacentre.

In this series, I’ll document the steps I take to add the new pool, migrate the users, redirect the external services and decommission the old pool. Hopefully it’ll all go smoothly, but we’ll see.