Great script created by Shaun Ritchie that will perform a rolling reboot of all Servers in a Delivery Group.It starts by placing servers with no sessions in Maintenance Mode and rebooting them one by one. All servers with active sessions are placed in Maintenance Mode to prevent new sessions. Any servers in Maintenance Mode when the script was started are ignored.
To prevent “breaking” your delivery group, if all servers have active sessions a percentage of servers are “held” for reboot later in the script. Otherwise users would be prevented from logging on. This is 20% by default but can be configured using the –HoldPercent parameter.Servers in Maintenance Mode do not allow new connections but allow users to reconnect to their sessions.
Virtual Servers are rebooted using Hypervisor, physical are rebooted via Windows OS. By default the script uses the Hypervisor.
Once all servers with no sessions are rebooted, the servers with active sessions are checked every 5 minutes to see if all sessions have cleared down. Once all sessions are logged off the server is rebooted and taken out of Maintenance Mode.
If any servers were “held” for reboot they are rebooted at the end.
The script will end after all servers are rebooted or it times out (24 hours by default). All servers are taken out of maintenance mode after reboot and again at the end of the script to make sure.
Status reports are written to screen and file during various stages of the script. The status report will list: All servers, whether pending, hold, or rebooted, reboot time, whether in Maintenance Mode, and session count.