Flickering Screen in an Citrix Environment


After we moved the customer environment from XA 6.15 to 7.15 we had the problem, that the users complained about their desktop. it was flickering every now and then. Sometimes after 2 MInutes sometimes after an hour. No special programm was runned which could have been causing the issue.
 After a long troubleshooting session we came accross, that the flickering always occured during the GPO Upate running all 90 minutes in the background. We made a call with Microsoft and they responded it was by design
  • "Consider notifying users that their policy is updated periodically so that they recognize the signs of a policy update. When Group Policy is updated, the Windows desktop is refreshed; it flickers briefly and closes open menus. Also, restrictions imposed by Group Policies, such as those that limit the programs users can run, might interfere with tasks in progress."


We now took the user policy auto update out of the productive environment and created a powershell script for urgent updates, where we can roll out the policies without user impact in the background.
The machine policys will be updated every 8 hours.

Here is the Powershellscript for manually updating the User policy:


Run GPupdate remote on Citrix Servers
(The used command Invoke-GPupdate generates a scheduled task on the servers.
This task starts the GPupdate process normally in the next 10 minutes.)

Select Citrix Farm "Prod" or "Test"

.PARAMETER DeliveryGroup

Select the DeliveryGroup which will get the GPupdate

Use "all" to send GPupdate to all Citrix Servers


# Get user choice for XA Farm "Prod" or "Test" or what else you have
$Farm = Read-Host -Prompt "1 = XA7 Prod`n2 = XA7 Test`nPlease Enter Farm Number "

# "1 = XA7 Prod`n2 = XA7 Test`nPlease Enter Farm Number " enteryour Farm Names here

# Set DeliveryController according to "Prod" or "Test" or how ever you call your farm
Switch ($Farm) {
1 {

2 {

default {
"No Farm selected, exiting"



Write-Host "Using Delivery Controller '$DeliveryController'"

Add-PSSnapin Citrix*

# Read available DeliveryGroups
$DeliveryGroups = Get-BrokerDesktopGroup -AdminAddress $DeliveryController | Sort-Object -Property Name

# Write DeliveryGroups with count in hashtable
$DeliveryGroupsHash = @{}

$Count = 1

foreach ($DeliveryGroup in $DeliveryGroups) {
$DeliveryGroupsHash.Add("$($Count.toString("00"))", "$($DeliveryGroup.name)")
# Add selection for "All Servers" to hastable
$DeliveryGroupsHash.Add("99","All Servers")

# Show selection menu
Write-Host "==============================================="

$DeliveryGroupsHash.GetEnumerator() | sort -Property name | ft -AutoSize

Write-Host "==============================================="


# Get selection from user input
$SelectedDeliveryGroup = Read-Host -Prompt "Please Enter Number of DeliveryGroup"


$SelectedDeliveryGroup = $DeliveryGroupsHash.Get_Item("$SelectedDeliveryGroup")

if ($SelectedDeliveryGroup -eq $null) {Write-Host "Wrong Number, exiting" -ForegroundColor Red; break}

# Write user choice
if ($SelectedDeliveryGroup -eq "All Servers") {
Write-Host "Your choice: All Servers"


else {
$SelectedDeliveryGroup = $SelectedDeliveryGroup.Substring(0)
Write-Host "Your choice: $SelectedDeliveryGroup"



# Read "All Servers" or "Servers from specified DeliveryGroup"
if ($SelectedDeliveryGroup -eq "All Servers") {
$Servers = (get-brokermachine -AdminAddress $DeliveryController -MaxRecordCount 9999).HostedMachineName

else {
$Servers = (get-brokermachine -AdminAddress $DeliveryController -DesktopGroupName $SelectedDeliveryGroup -MaxRecordCount 9999).HostedMachineName
Write-Host "Wait 10 seconds, then GPupdate will start on '$SelectedDeliveryGroup'"


sleep -Seconds 10

# Start GPupdate on the servers
foreach ($Server in $Servers) {
Invoke-GPUpdate -Computer $Server -Target "Computer" -ErrorAction Ignore

Write-Host Starting GPupdate on $Server


Write-Host "Wait 60 seconds, then script will exit"

sleep -Seconds 60


Popular posts from this blog

Export a list of all XenApp 7.x published applications via Powershell

Implementing Single Sign On with NetScaler and Kerberos Constrained Delegation (KCD)

How to: Create a Client Certificate for LDAPS with OpenSSL