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!

Skype for Business Blog by Mark Vale

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.

Populate ProxyAddresses when migrating to Office 365

We’ve had a couple of customers with a hosted Lync/SfB installation and Exchange Online where the users don’t have the ProxyAddresses field declared, and as a result, the users have EWS integration problems. The most noticeable for users is that their conversation history folder doesn’t capture history beyond the point where they migrate to Exchange Online.

This may be fairly unique to us, as we build hosted Skype for Business environments which ADSync user details back from the customer’s onsite active directory to ours. When they sync to 365, they’ll generally do it from their AD as well, so there’s a bit of a disconnect.

To fix the problem, either manually go through each user and add their default SMTP address to the ProxyAddresses field, or use the following script:

Import-Module ActiveDirectory
$domainController = 'dc1.contoso.com'
$searchBase = 'OU=users,DC=contoso,DC=com'
$users = Get-ADUser -SearchBase $searchBase -SearchScope Subtree -Filter { ObjectClass -eq "user" } -Properties ProxyAddresses
ForEach ($user in $users) {
 $newSMTP = 'SMTP:' + $user.userprincipalname
    Write-Host "Adding $newSMTP to" $user.SamAccountName
 Set-ADUser -identity $user.DistinguishedName -Add @{ProxyAddresses = $newSMTP} -server $domaincontroller
}

This script will run through the list of users in a specified OU and add the user’s default SMTP address by using their UserPrincipalName. If your users’ SMTP addresses don’t match your UserPrincipalName, and instead are samaccountname@domain.com, substitute the following for the $newSMTP variable:

$newSMTP = 'SMTP:' + $user.SamAccountName + '@contoso.com'

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
)

}
}

PowerShell One-Liners: Watching output

Up, enter. Up, enter. Up, enter. Up, enter.

Those two keys are probably being mashed right now somewhere in the world as an engineer waits for a system to do something. Back in my *Nix days, I would have just thrown ‘watch’ in front of whichever command I wanted to keep an eye on and let the shell take care of things for me, but there isn’t quite an analogue in the Windows world.

We can do the same sort of thing, however, by issuing a one line command which repeats until you issue a control-C. For example:

while ($true) {clear;date;netstat -an | findstr LISTENING; sleep 5}

I was using this command today when working with a third party SIP server to make sure the service started listening on the right IP address, and kept refreshing every 5 seconds so I didn’t have to keep tabbing back to a powershell/cmd window to reissue a command.

The basic anatomy of this little script is this:

while ($true)                          # true is always true, so the loop always executes
{                                      # start of the loop
clear;                                 # clear the screen
date;                                  # print the date and time
netstat -an |findstr LISTENING;        # the command you wish to repeat
sleep 5                                # wait for X seconds. in this case 5.
}                                      # end of the loop

The clear and date at the start makes me feel like I’m using the Linux watch command, I guess. Old habits die hard. Note that this is still the same script as the first one, but I’ve just broken it out to separate lines and added comments (the stuff behind the hashes).

Other examples:

# Which services are running?
while ($true) {clear;date;Get-CsWindowsService;sleep 5}
# How are my routing groups looking after I rebooted one of my frontends?
while ($true) {clear;date;Get-CsPoolFabricState -PoolFqdn YourPool.domain.local;sleep 5}
# How many users are logged in before I start patching?
while ($true) {clear;date;(Get-CsUser -OnLyncServer).Count
# How many PSTN calls are active before I take down my mediation server?
while ($true) {clear;date;Get-CsWindowsService -Name RTCMEDSRV | select activitylevel;sleep 5}

We can even take that a step further, by setting a run limit. Let’s say that I wanted to run a command 10 times only. All I need to do is initialize a counter, set the script to only run if the counter is less than or equal to 10, and then get the loop to increment the counter by one each time.

$counter = 1
while ($counter -le 10) {clear;date;$counter;Get-CsWindowsService;sleep 5;$counter = $counter + 1}

How will my Skype for Business call perform?

If you’ve ever been about to jump on an important call or conference, and worried that the network where you are may not be up to the task, then it’s probably a good idea for you to check out the PreCall Diagnostic tool. It’s perfect for when you’re outside your organization, on a public network or on 4G.

Once you start the tool, you’ll need to log in with the details of your Skype for Business or Lync 2013 account. Pressing Start Test will, by default, run a two minute test where it will measure the connection quality between your computer and the server to which you’re connecting. In my case, it’s my edge server as I’m at home.

In the example below, you can see the quality was fine at the beginning of the test, but then I saturated my internet connection by adding a large file to my OneDrive folder (always an excellent test!). Jitter and packet loss spiked, and the overall Mean Opinion Score of the call decreased. This would have resulted in a call which was considered relatively poor.

precall example

Give it a try and see how your network connection compares.

Polycom VVX 5.3.x and 5.4.x Visual Voicemail not working

We fired up some fresh Lync accounts the other day for a couple of users who were going to only be using a VVX 500 handset. They weren’t even going to be using the Lync/Skype client for messaging – they were just telephony users. I can imagine a number of scenarios where you may have this type of user, like a concierge or guard station where only a phone is required.

Unlike all the rest of our users, these accounts didn’t see their voicemails listed when they pressed the messages icon on their phone. Dialing in to the unified messaging subscriber access was fine, and the messages were there, but they just weren’t showing up when the user pressed the envelope icon.

Diving in to the logs on the phone showed the following:

0714111143|ec   |4|00|UM service is 1 and play on phone service is 1
0714111148|ec   |4|00|’calllogs’ service did not received expected folder ids.

Aha! Can’t find the voicemail folder, eh Lync?

Sure enough, when you log in to Outlook, you’ll find that the normal Lync folders haven’t been created yet. I assume that the Polycom UC software is set to look in the “Voice Mail” search folder, but as this folder hasn’t been created the phone gives up and shows a blank screen.

The solution? Log in to the account once with the desktop Lync 2013 / Skype for Business client. This initial login will create all the necessary folders required, and visual voicemail will start working correctly.

Skype for Business for Windows Phone Quietly Arrives

A little while ago an update was seeded to Lync 2013 users on Windows Phone which let us know that Skype for Business was on its way. Today that rollout has taken place, at least for me, with the latest version being delivered to my devices overnight. It’s always nice to wake up to new software. It’s been delivered as an in-place upgrade for Lync 2013 for Windows Phone.

So far it’s just Windows Phone which has received this update (or Windows 10 Mobile if you’re using it). Android and iPhone should be coming soon.

Continue reading