Group Policy Failure After Upgrading to XenApp and XenDesktop 7.14

Group Policy Failure After Upgrading to XenApp and XenDesktop 7.14

book

Article ID: CTX224755

calendar_today

Updated On:

Description

Group policies in Citrix Studio are missing if the UPM - Software\Microsoft\Speech_OneCore policy under Profile Management > Registry > Default Exclusions was configured before upgrading the Delivery Controller from 7.11 to 7.14, from 7.12 to 7.14, or from 7.13 to 7.14.

Scenario 1:
After upgrading, you may experience the following error when trying to add/modify Citrix Policies with Studio 7.14:
Error ID:XDGP:BC0F745B. “Exception: System.Collections.Generic.KeyNotFoundException. The given key was not present in the dictionary.”

Scenario 2:
If trying to apply group policies through Active Directory, the Citrix AD GPO Plugin may throw an MMC error.
“The policy cannot be updated. System.Runtime.InteropServices.COMException 0x80004005: Error HRESULT E_FAIL has been returned from a call to a COM component.”
User-added image

Environment

This software application is provided to you as is with no representations, warranties or conditions of any kind. You may use and distribute it at your own risk. CITRIX DISCLAIMS ALL WARRANTIES WHATSOEVER, EXPRESS, IMPLIED, WRITTEN, ORAL OR STATUTORY, INCLUDING WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NONINFRINGEMENT. Without limiting the generality of the foregoing, you acknowledge and agree that: (a) the software application may exhibit errors, design flaws or other problems, possibly resulting in loss of data or damage to property; (b) it may not be possible to make the software application fully functional; and (c) Citrix may, without notice or liability to you, cease to make available the current version and/or any future versions of the software application. In no event should the software application be used to support ultra-hazardous activities, including but not limited to life support or blasting activities. NEITHER CITRIX NOR ITS AFFILIATES OR AGENTS WILL BE LIABLE, UNDER BREACH OF CONTRACT OR ANY OTHER THEORY OF LIABILITY, FOR ANY DAMAGES WHATSOEVER ARISING FROM USE OF THE SOFTWARE APPLICATION, INCLUDING WITHOUT LIMITATION DIRECT, SPECIAL, INCIDENTAL, PUNITIVE, CONSEQUENTIAL OR OTHER DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. You agree to indemnify and defend Citrix against any and all claims arising from your use, modification or distribution of the software application.

Resolution

As a workaround, remove the policy UPM - Software\Microsoft\Speech_OneCore policy before upgrading the Delivery Controller.

Solution for Scenario 1:
If the policy is not removed before the upgrade and you experience the symptom for Scenario 1 above, as a workaround, you can either download the attached package and run the FixPolicies.ps1 file or complete the following steps manually:

NOTE: Before running the script or completing the steps manually:

  • Read the ReadMe file
  • Create a backup of your database
  • Save a copy of the policies.xml file after your existing policies have been saved to the file (see Steps 1 and 2 below)

 
IMPORTANT: If you receive an error after Step 5 below, do not re-execute Steps 1-5 by using the same policies.xml file name. The policies.xml file contains all the existing policies you have created for your previous deployment. Instead, check the log file for information or errors about what was done by the script. Then rename the previous policies.xml file and capture a new policies.xml file.
 
WARNING: Step 5 deletes all existing policies.

  1. Open a PowerShell window. Make sure the execution policy is set to allow script execution.
  2. Run command: Import-Module .\ExportPolicy.psd1
  3. Run command: Export-Policy -XmlOutputFile .\policies.xml. Before continuing, validate the policies.xml file to ensure it is not empty and there are no errors displayed in PowerShell after running the command.
  4. Add the Broker snap-in: Add-PSSnapin Citrix.Broker.*
  5. Delete all existing policies: Import-BrokerDesktopPolicy 0,0,0,0,0,0,0,0
  6. Run command: Import-Module .\ImportPolicy.psd1
  7. Run command: Import-Policy -XmlInputFile .\policies.xml

Take note of the log file locations generated by the export and import commands for future reference.

If no error is seen, the workaround is complete and you should be able to use Citrix Studio to edit policies as normal. If an error similar to the one below is seen, close the PowerShell window and open a new PowerShell window, then reimport the ImportPolicy.psd1 modules and continue the import.

Import-Module : A drive with the name 'LocalGpo' already exists.
At C:\ExportPolicy.psm1:372 char:13
+ Import-Module $s.ModuleName
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (LocalGpo:String) [Import-Module], ProviderInvocationException
+ FullyQualifiedErrorId : DriveAlreadyExists,Microsoft.PowerShell.Commands.ImportModuleCommand

Solution for Scenario 2:
The AD GPO symptom as stated in Scenario 2 above cannot be corrected using the script. It can only be manually corrected by fixing the GPO that has the offending setting configured. Edit the GPO using a version of Citrix AD GPO plugin that supports the setting to have the UPM - Software\Microsoft\Speech_OneCore setting removed. Or modify/delete the GPO so that it is not applied to the 7.14 environment.

Issue/Introduction

If trying to apply group policies through Active Directory, the Citrix AD GPO Plugin may throw an MMC error. “The policy cannot be updated. System.Runtime.InteropServices.COMException 0x80004005: Error HRESULT E_FAIL has been returned from a call to a COM component.”