Citrix Virtual Apps and Desktops

Remove deprecated policy settings after an upgrade

When Citrix® deprecates a product component, its associated policy settings become invalid. Use GpoClean.ps1 to identify and remove these deprecated settings from Citrix Virtual Apps and Desktops™ policies after an upgrade, including any policies that become empty as a result.

Before you begin

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

  • A supported version of Citrix Virtual Apps and Desktops with Broker SDK and Group Policy Management installed
  • Citrix policy administration permissions on a Delivery Controller™

Note:

The script automatically loads the Citrix.Broker.Admin.V2 and Citrix.Common.GroupPolicy snap-ins.

Remove deprecated policy settings

Run GpoClean.ps1 to remove deprecated policy settings:

  1. Copy GpoClean.ps1 to a Delivery Controller on which you have Citrix policy administration permissions.
  2. Open a PowerShell session on the Delivery Controller.
  3. Run the script. No parameters are required.

    .\GpoClean.ps1
    <!--NeedCopy-->
    

    Note:

    Add -Verbose for detailed per-setting logging: .\GpoClean.ps1 -Verbose.

The script runs in two phases:

Phase What happens
Phase 1 Runs Test-BrokerDesktopPolicy, identifies DeprecatedSetting errors, and sets each affected setting to NotConfigured
Phase 2 Re-runs Test-BrokerDesktopPolicy, identifies policies with no configured settings (PolicyHasNoSettings), and removes them

All changes are saved in a single write operation. A summary reports the number of settings and policies removed. If no deprecated settings are found, the script exits with no changes.

Note:

  • The Unfiltered policy is never removed, even if it contains no configured settings.

For more information about deprecated settings in each release, see Policy changes.

Remove deprecated policy settings after an upgrade