← script library

Reboot a Server and Resume the Runbook

ServerEngine PlatformAugust 17, 2026

The one line that makes a reboot part of an automation run rather than the end of it: the host restarts, ServerEngine waits for it to come back and the runbook continues at the next script. Everything else in this library that reports a pending reboot exists to be chained in front of it.

powershell
# ServerEngine can handle system reboot cycles
# and seemlesy continue the next scripts when using Runbooks.
# ServerEngine initiates a waiting sequence and after
# successfull reconnection the cycle ends
#-------------------------------------------------

# Use this specific line for managed reboot cycles
Invoke-Command { Start-Sleep 3;Write-Host " ""State : Reboot"" ";Restart-Computer -Force }; Exit-PSSession

Run it across your fleet

This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.

Ready when you are.

Try ServerEngine free for 7 days.