Thursday, April 20, 2017

Copy the Skype for Business policies - client, voice etc.

Copy the Skype for Business client policy
Many times, we need to create new policies with new features keeping previous one intact. Then we wonder if there is option to copy the policies, unfortunately there is no native option in skype for business.
This post will describe a workaround to copy the skype polices and create new policy with old settings
I am taking an example for client policy, however you can apply it to any policies.
Steps:
  1. Export the contents of client policy using export-clixml functionality
Get-CsClientPolicy test-policy | Export-Clixml c:\temp\UC-ClientPolicy.xml
  1. Find the xml file, open with notepad ++, it will look something like

You will see all configured settings mentioned in xml file.

  1. You will also see following information that is more important to consider while copying the policies. (open XML file in notepad++ and scroll at the end)
More important parameter is Anchor, also can be called as identity. When a new policy is created, it is assigned as numeric identity.
Even if you delete the policy, this number will not be deleted and will never be re-used.
  1. So now create new policy
New-CsClientPolicy Test-Policy-Pilot
  1. Now export this policy and open the xml file in notepad ++. (will not go over step by step)
  2. Again, the important part to consider is anchor, you will see a different value for anchor.

  1. So now, take note of anchor and name from new client policy and edit the existing policy’s XML file.
  2. Go to Line - <S N="Anchor">(6) Test-Policy</S>
  3. Replace exact anchor and name. For me, I have copied “(22) Test-Policy-Pilot” and replace it in existing XML file. And then identity from next line too, replace the exact same name with new one. Save the XML file.
  4. Run the following command
Import-Clixml -Path C:\temp\new\copy\Test-Policy.xml | Set-CsClientPolicy

Voila!!!! Done we just copied the client policy.
Happy Skyping!!!