Script: New-CsClonedPolicy.ps1 – Clones Existing Lync 2013 Policy To a New Policy
Some Lync 2013 policies have few parameters, like User Services Policies. Others, like Conferencing Policies, have a considerable number of parameters. Often, organizations need to have different policies for different groups of people. Many times, there is only one or two settings that are different. Creating a new policy based on an existing policy can be time consuming. There are some cool utilities like Kevin Peters’ coolÂ StareCompare, which shows where policy settings are different between two policies. But what if it was just easier to “clone” an existing policy to a new policy, and thenÂ just change the few settings that need changing? NextHop has a nice articleÂ on how to just that. You export the current policy to an XML file, edit the file, then import it into a new policy. Must faster, but still requires some manual editing of an XML file. Ya know why I don’t like that method? Not enough PowerShell! So what I did was write a script that automates that method, and allows you to clone anÂ existing policy to a new policy in one step. The script exports the existing “source” policy, updates the XML, then imports into the “target” policy. One command to make life easier. Then you can use the appropriate “set” cmdlet to tweak the new policy. And it works with all Lync 2013 policy types, including Archiving, Client, ClientVersion, Conferencing, ExternalAccess, HostedVoicemail, Location, Mobility, NetworkInterSite, PersistentChat, Pin, Presence, UserServices, Voice, and VoiceRouting. The script only works with Lync 2013 policies, and only runs on PowerShell 3.0 or higherÂ (Windows Server 2012 or later).
The script supports Get-Help, so run that if you need additional info.
New-CsClonedPolicy.ps1 [[-ExportFolder] ] [[-ExportFile] ] [[-SourcePolicyName] ] [[-TargetPolicyName] ] [[-PolicyType] ] [[-Description] ] 
An example would be
New-CsClonedPolicy.ps1 -SourcePolicyName global -TargetPolicyNameÂ "new policy" -PolicyTypeÂ ConferencingPolicy
This would clone the global conferencing policy into a new policy called “new policy”. Acceptable values for PolicyTypeÂ are “ArchivingPolicy”, “ClientPolicy”, “ClientVersionPolicy”, “ConferencingPolicy”, “ExternalAccessPolicy”, “HostedVoicemailPolicy”, “LocationPolicy”, “MobilityPolicy”, “NetworkInterSitePolicy”, “PersistentChatPolicy”, “PinPolicy”, “PresencePolicy”, “UserServicesPolicy”, “VoicePolicy”, and “VoiceRoutingPolicy”
Execution Policy: Third-party PowerShell scripts may require that the PowerShell Execution Policy be set to either AllSigned, RemoteSigned, or Unrestricted. The default is Restricted, which prevents scripts – even code signed scripts – from running. For more information about setting your Execution Policy, see Using the Set-ExecutionPolicy Cmdlet.
v1.2 – 06-10-2014 – New-CsClonedPolicy.v1.2.zip
v1.1 – 02-08-2014 – New-CsClonedPolicy.v1.1.zip
v1.0 – 09-03-2013 – New-CsClonedPolicy.v1.0.zip
See the changelog for information on what’s changed/included in each version.