Citrix Chained Reboot Scripts, now supporting Citrix Cloud, Citrix Virtual Apps and Desktops (CVAD), and XenApp/XenDesktop 5, 6, 6.5, and 7.x!

Share Button

Updated 2018.12.22: Revision 1.9 Now Supports Citrix Cloud!

One script now works with all current and modern versions of XenApp, XenDesktop, Citrix Virtual Apps and Desktops (CVAD), and Citrix Cloud Virtual Apps and Desktops Service from 7.0 and later, through 1811.

In zero-downtime 24/7 environments with shift employees, customers rarely want users to be notified of scheduled or mandatory XenApp server reboots. As a result, most of these environments have reboots disabled or this process is done manually. Unfortunately, this isn’t a good process since the XenApp servers are susceptible to memory leaks which can lead to failure and poor performance. By utilizing the included Chained reboot scripts, environments can take advantage of N+1 overallocation by processing a single server reboot while maintaining the user load on remaining systems. This has been done in such a way that users are not kicked off the system for scheduled reboots.  Instead, the server is removed from load balancing until all sessions have been logged off. Once all sessions have been logged off, the server will go down for a reboot.

Share Button
  1. KevinKevin01-27-2017

    Is the Reboot Interval the amount of time between when the last server was rebooted and when the next server will be rebooted?

    Could I get a more detailed explanation of the Farm Loop Interval?

  2. Hello Dane,

    On line 197 of the 6.5 script I had to replace the $Deliverygroupname with $Workergroupname. This was from a download I did last week.


  3. Has anyone tried this script in a XenApp 7.9 farm?

  4. AlexAlex10-31-2016

    Hello, is there any support for 7.9?

    • Alain P AssafAlain P Assaf07-17-2017

      I’m currently using it on a 7.9 farm. I’m still looking into an issue with it not working with my Windows 7/XenDesktop delivery groups.

  5. TyronTyron09-11-2016

    Hello Dane,
    Thank you for this amazing script!
    If possible, I would like to suggest the change below. With this code, you will check if the same script was called (not only check for any Powershell). That way, if some other admin logs into the server and forgets the Powershell console open, it won’t impact the execution of the scheduled task.

    Remove this:
    $powershells = @(get-process | Where {$_.ProcessName -eq “powershell”}) # Query all running processes to see if Powershell is running
    foreach ($p in $powershells) {$processes+=1} # Validate that there is already a powershell instance running

    Add this:
    $processes=((Get-CimInstance Win32_process -Filter “name = ‘powershell.exe'” | where {$_.CommandLine -match $MyInvocation.MyCommand.Name} | measure).count)

Leave a Reply