Citrix XenDesktop Studio Error – Changes made to Policies Outside of this console, such as PowerShell or management tools from previous versions, resulted in a discrepancy between policies

I am not sure what I have done wrong in this case  and these things happen when you least expect. I was doing some changes to Citrix policies and had to add a couple of new policies to setup XenDesktop printing for my customer. I did also rearrange the policy priorities and that’s all I know or could remember. Policy node under Studio started throwing the below error message.

The priorities for policy Unfiltered and policy <policy name> interfere with each other in the “user” and “computer” components. The priorities must be assigned in the same order for both policies

Capture37

That’s the first time I had ever come across something like that and I knew I had to work my magic with PowerShell to get it right. I still wasn’t sure of managing Citrix Policies via PowerShell. Did a quick Google search and came across this from Citrix http://blogs.citrix.com/2013/07/15/merging-of-user-and-computer-policies-in-xendesktop-7-0/

Ok, that gave me a start. I decided to give it a try and see what is in store for me.

 

Ran PowerShell in admin mode and entered the below command.

asnp Citrix*

Mount a drive letter for the provider, here I’m using “Site” as the drive and running it right from the Broker/DDC server

New-PSDrive Site -PSProvider CitrixGroupPolicy -Root \ -Controller localhost

Capture38

cd Site:\User

Now you are in the User policy container and will be able to see all the XenDesktop User Policies. I took a note of  the policies that showed issues from the error message before and checked their priorities and I couldn’t find anything wrong with the assigned priorities. That’s different to what the error said.

To see all the User policies run the below

ls

Capture39

 

I did the same for the Computer policy as well by running the below

cd..
cd Computer
ls

 

Took note of the priorities and of course they are different as well. I ported the results in a Notepad and did a comparison as well and they indeed have different priorities

Name : Profile Settings and User Workspace for VDI Users
Description : This Policy will NOT take effect on Windows XP and Win Server 2003 due to UPM v5.0
Enabled : False
Priority : 4
PSPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\User\Profile Settings and User Workspace for VDI
Users
PSParentPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\User
PSChildName : Profile Settings and User Workspace for VDI Users
PSDrive : Site
PSProvider : Citrix.Common.GroupPolicy\CitrixGroupPolicy
PSIsContainer : True
*************************************************************************************************
Name : Profile Settings and User Workspace for VDI Users
Description : This Policy will NOT take effect on Windows XP and Win Server 2003 due to UPM v5.0
Enabled : False
Priority : 3
PSPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\Computer\Profile Settings and User Workspace for
VDI Users
PSParentPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\Computer
PSChildName : Profile Settings and User Workspace for VDI Users
PSDrive : Site
PSProvider : Citrix.Common.GroupPolicy\CitrixGroupPolicy
PSIsContainer : True
**********************************************************************************************************
Name : Unfiltered
Description : This is the system-created default policy, it cannot be deleted. Note that its settings will apply to
all connections.
Enabled : True
Priority : 5
PSPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\User\Unfiltered
PSParentPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\User
PSChildName : Unfiltered
PSDrive : Site
PSProvider : Citrix.Common.GroupPolicy\CitrixGroupPolicy
PSIsContainer : True
*********************************************************************************************************************
Name : Unfiltered
Description : This is the system-created default policy, it cannot be deleted. Note that its settings will apply to
all connections.
Enabled : True
Priority : 2
PSPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\Computer\Unfiltered
PSParentPath : Citrix.Common.GroupPolicy\CitrixGroupPolicy::Site:\Computer
PSChildName : Unfiltered
PSDrive : Site
PSProvider : Citrix.Common.GroupPolicy\CitrixGroupPolicy
PSIsContainer : True
**************************************************************************************************

Next, I tried to disable one of the conflicting policies. Remember, this needs to be done for both User and Computer containers.

Computer Policy First

Capture40

Ran the above to check the Status of the policy I want to disable.

Now run the set command as below

Set-ItemProperty . -Name Enabled -Value False

Capture41

Repeat the same for the User container for the same policy as below

Capture42

I thought that had fixed it and went back to Studio and gave the Policy node a refresh. Nope, it didnt.

Still the same error.

I decided to remove the offending policy altogether; again this had to be done for the User and Computer.

From the Computer Container – you need to run the below to remove the Computer settings in the policy

Remove-Item "Profile Settings and User Workspace for VDI Users"

Capture43

When PS prompts, say A to remove all the child objects and Recurse parameters

Perform the same for User settings for the same policy. Same command as before but from the User space.

Capture44

Remove-Item "Profile Settings and User Workspace for VDI Users"

 

 

Refresh the Policy node in Studio and viola, I can see all my policies with an exception of the deleted one. I don’t mind it now as I can easily recreate it and I just didn’t have the time to investigate further. A word of advice, it is always recommended to save your Prod policies as a template so in case they gets corrupted, they can be easily reinstated. you would still have to apply the filters though.

 

7 responses to “Citrix XenDesktop Studio Error – Changes made to Policies Outside of this console, such as PowerShell or management tools from previous versions, resulted in a discrepancy between policies”

  1. […] Citrix XenDesktop Studio Error – Changes made to Policies…. = WWW […]

  2. Hi MOHAN, need Your help,

    Citrix Policies:
    Changes made to policies outside of this console, such as in PowerShell or management tools from previous versions, resulted in a discrepancy between policies.
    The assigned objects for policy WAN must watch object delivery group has assignment allow Branch User in the User component & allow branch user in the computer component

    1. Hi Mate, i see that you did have a similar issue with what i have got on the blog post. Have you manage to fix it yet?

  3. Perfect work yoս have done, this website is certainly coopl
    with excellent information.

  4. Thanks this was mega helpful!!

  5. This was just what i was looking for! Many thanks for the tip…

Leave a reply to Lal Mohan Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.