[This is pre-release documentation and subject to change in future releases. This topic's current status is: Writing]

Topic Last Modified: 2010-03-30

Microsoft Communications Server 2010 features a huge number of cmdlets that enable you to retrieve, edit, create, and remove policies; what the software doesn’t include, however, are any cmdlets that enable you to copy the property values from one policy to the next. For example, there’s no straightforward way to copy a voice policy configured for the Redmond site to the Dublin site.

If you need to copy policy values from one policy to another it’s possible to do so using a Windows PowerShell script. To use the script, copy the code, paste it into a text editor such as Notepad, and then save the file using a .ps1 file extension (for example, C:\Scripts\CombinedOutput.Ps1). From within the Communications Server Management Shell you can then run the script by typing in the full path to the script file followed by the Identity of the policy you want to copy from (the template) and the Identity of the policy you want to copy to:

Copy Code
C:\Scripts\CopyVoicePolicy.ps1 "Redmond" "Dublin"

This prototype script will retrieve all the values from the Redmond voice policy, then assign four of those values (for the properties AllowSimulRing, AllowCallForwarding, AllowPstnRerouting, and DisableDelegation) to the Dublin policy. To assign all the property values from the Redmond policy to the Dublin policy you would simply need to add the appropriate parameters (and parameter values) to the sample script:

Copy Code
$x = Get-CsVoicePolicy -Identity $args[0]
$y = Get-CsVoicePolicy -Identity $args[1]

Set-CsVoicePolicy -Instance $y -AllowSimulRing `  
  $x.AllowSimulRing -AllowCallForwarding $x.AllowCallForwarding `  
  -AllowPSTNReRouting $x.AllowPSTNReRouting -DisableDelegation `
  $x.DisableDelegation