Share via


Synchronise Skype for Business Normalization Rules in a Site scoped “Dial Plan” to a User scoped “Dial Plan” using Powershell

Hi Everyone

Today I needed to help a customer synchronise Dial Plan normalization rules from a Site Dial Plan to a User Dial Plan. It was something I hadn't done before so I needed to do a bit of digging into possible Powershell commands that could do the job. The customer had quite a few normalization rules (which probably need to be rationalised *mental note*) and so we didn't want to move the rules by hand.

I created a blank Dial Plan (user scoped Dial Plan) and then populated the Normalization Rules using the below Powershell commands.

I also tested the commands between a User targeted Dial Plan and another User targeted dial plan. The syntax largely worked but need some minor tweaks (included as the 2nd example).

Anyway, I thought I'd share the sample Powershell in case anyone else wanted to do something similar. As always *PLEASE TEST IN TEST ENVIRONMENT BEFORE USING*!.

Enjoy!

Happy Skype'ing

Steve

PS sorry about the quotes appearing in the blog with left and right double quotes, you'll need to use the normal quotes in Powershell.

 

$strSourceDialPlan="Site:Canberra"

$strTargetDialPlan="Test Dial Plan"

 

Get-CsDialPlan -Identity $strSourceDialPlan | Select -ExpandProperty NormalizationRules | Select Name `

| %{$strName =$_.name; $strPolicy = "$strSourceDialPlan /$strName" ; write-host $strPolicy; `

$objPolicy=Get-CsVoiceNormalizationRule $strPolicy; Set-CsDialPlan -identity $strTargetDialPlan -NormalizationRules @{add = $objPolicy}}

 

If you would like to synchronise from a user scoped dial plan to another user scoped dial plan then use these commands.

$strSourceDialPlan = "Sydney Users"

$strTargetDialPlan = "Test Dial Plan"

Get-CsDialPlan -Identity $strSourceDialPlan | Select -ExpandProperty NormalizationRules | Select Name `

| %{$strName =$_.name; $strPolicy = "Tag:$strSourceDialPlan/$strName" ; write-host $strPolicy; `

$objPolicy=Get-CsVoiceNormalizationRule $strPolicy; Set-CsDialPlan -identity $strTargetDialPlan -NormalizationRules @{add = $objPolicy}}