Citrix Virtual Apps and Desktops

Prioritize policies

Note:

Starting with version 2511, Citrix Web Studio™ (web-based) is the only management console for Citrix Virtual Apps and Desktops™. Citrix Studio (MMC-based) has been removed from the installer. This article applies only to Web Studio. For information about Citrix Studio, see the equivalent article in Citrix Virtual Apps and Desktops 7 2212 or earlier.

When multiple policies apply to a connection, Citrix Virtual Apps and Desktops™ evaluates them in priority order. A lower number means a higher priority (1 is the highest). When conflicting settings exist across policies, the setting from the highest-priority policy takes effect.

You can change policy priority using Web Studio or PowerShell.

Change policy priority using Web Studio

  1. In Web Studio, select Policies in the left pane.
  2. On the Policies tab, select Change Policy Priorities from the action bar.
  3. On the Change Policy Priorities page, reorder policies using any of the following methods:

    • Drag a policy to a desired position.
    • Click the Up or Down arrow icon to move it one position.
    • Click the Top or Bottom arrow icon to move it to the first or last position.
    • Click the Edit icon, enter a priority number, and then click Save.
  4. Click Save to apply changes.

Change policy priority using PowerShell

Use the Set-GpoPolicyPriority.ps1 script to programmatically reorder policy priorities. The script accepts a policy name and a target priority number, resolves policy GUIDs internally, and applies the updated order using Set-BrokerGpoPolicyPriorities. Use this approach when you manage policy priorities through automation instead of the Web Studio console.

The native Set-BrokerGpoPolicyPriorities cmdlet requires a fully ordered list of policy GUIDs. This script removes that complexity by accepting a policy name and desired priority, then handling GUID resolution automatically.

Before you begin

Make sure you meet these requirements before you run the script:

  • A supported version of Citrix Virtual Apps and Desktops with the Broker SDK installed
  • The script must run on a Delivery Controller™ with the Citrix Broker SDK installed
  • PowerShell snap-in: Citrix.Broker.Admin.V2 (loaded automatically by the script)

Run the script

  1. Copy Set-GpoPolicyPriority.ps1 to the Delivery Controller.
  2. Open a PowerShell session on the Delivery Controller.
  3. Run the script with the required parameters.

    .\Set-GpoPolicyPriority.ps1 -PolicyName "<PolicyName>" -NewPriority <Number>
    <!--NeedCopy-->
    

    Replace <PolicyName> with the name of the policy and <Number> with the target priority.

The script outputs the current and target priority, confirms the change, and runs a verification step. Add -Verbose for a detailed view of the reorder before the script applies it.

Parameters

Parameter Required Description
-PolicyName Yes Name of the policy to reprioritize
-NewPriority Yes Target priority (1 = highest). Use 0 or a negative number to move the policy to the highest position; use a number exceeding the policy count to move it to the lowest position
-PolicySetGuid No GUID of a specific policy set. Omit to target DefaultSitePolicies

Examples

Set a policy to the highest priority in the default policy set:

.\Set-GpoPolicyPriority.ps1 -PolicyName "MyPolicy" -NewPriority 1
<!--NeedCopy-->

Set a policy to the lowest priority:

.\Set-GpoPolicyPriority.ps1 -PolicyName "MyPolicy" -NewPriority 9999
<!--NeedCopy-->

Set a policy to priority 5 in a specific policy set:

.\Set-GpoPolicyPriority.ps1 -PolicyName "MyPolicy" -NewPriority 5 -PolicySetGuid "12345678-1234-1234-1234-123456789012"
<!--NeedCopy-->
Prioritize policies