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. RobertRobert06-22-2015

    Hi SK,

    I removed ‘@’ in line 125:
    $sessions = (get-brokermachine $server).SessionsEstablished

    and also changed line 147 to:
    Invoke-Expression “Shutdown.exe /m $dnsname /r /t 0 /c ‘Shutdown scheduled by Citrix farm chained reboot.'”

    Afterwards the script functioned as expected.

    Great work!!!! Thanke you Dane.

    • SKSK06-30-2015

      Hi Robert,

      i have made as suggested by you, but still its not working. FYI: I am using this script on XenApp 7.6 Farm but no luck

      Shekhar Reddy.

  2. LiamLiam06-18-2015


    Everything appears to be working except for the reboot part
    My troubleshooting appears that it’s kicking off the

    New-BrokerHostingPowerAction -Action ‘Restart’ -MachineName $server

    which the server sits as ‘proccessing’

    Is there a way to bypass that method so it will be forced to use the

    Invoke-Expression “Shutdown.exe /m $dnsname /r /t 0 /c “”Shutdown scheduled by Citrix farm chained reboot.”””


  3. JamesJames05-29-2015

    For some reason I can not get this to run properly on one of my Xenapp 6.5 farms. I have a second farm that it works as intended. Both scripts are configured identical. I have it running off of the ZDC. I see powershell.exe running but the servers just never reboot. Nothing in the event logs that I have found. Any help is much appreciated!

  4. SKSK05-21-2015

    hello Dane,

    i have placed this script on our XenApp 7.6 Farm. in Task scheduler script showing as running however servers are not getting rebooted. could you please let me know is there any permissions required to get the server rebooted or something i need to check


  5. JuergJuerg05-08-2015

    Download is working now. Thanks!

1 18 19 20 21 22 25

Leave a Reply to Dane Young Click here to cancel reply.