One client had a windows server with a memory leak problem that needed further investigation. While the application was still being checked, the production server had to be rebooted at least once a week.
What struck me was that they really assigned an FTE to log in after midnight to reboot the server manually. And this is really unnecessary.
While I understand that a highly critical system may need close supervision, most activities such as this can be done automatically using the shutdown.exe command tool. This tool is available on all Windows OS (server or desktop) and very handy for a super simple task like the case above. If needed, you can even do a more fancy automation with a script.
Nobody should do an extra work at odd hours just to reboot a server. You can always execute the shutdown command in advance by using a time-delay option.
For a server reboot with a time-delay, use the following command in Command Prompt window or Windows PowerShell:
PS H:\> shutdown /r /f /t 21600
/r – Restarts the computer after shutdown.
/f – Forces running applications to close without warning users.
Caution: Using the /f option might result in loss of unsaved data.
/t – Sets the time-out period before shutdown to xxx seconds.
In this example, the time is set to 21,600 seconds (or 6 hours).
Pay attention that you get a confirmation window to check when the system will be rebooted (bottom right corner).
If you make a mistake or just want to change your mind on the parameters, you can always cancel your job by using /a parameter (abort). This only works when you use the time-delay. Otherwise the shutdown is instantly executed.
PS H:\> shutdown /a
Then you can execute a new shutdown command with the new parameters.
For more available options, you can run shutdown with a /? flag or check the link at the end of this post.
Important: If you want to really shut down a computer or server, you need to use /s parameter (instead of /r), but only use it to a local workstation or server that you can access. I personally never use this flag for any remote systems.
It’s also worth repeating from the remarks, that the user id you use to execute this command has to have the proper access level:
- Users must be assigned the Shut down the system user right to shut down a local or remotely administered computer that is using the shutdown command.
- Users must be members of the Administrators group to annotate an unexpected shutdown of a local or remotely administered computer. If the target computer is joined to a domain, members of the Domain Admins group might be able to perform this procedure. For more information, see:
- Default local groups
- Default groups
Yes, there is a situation that warrants a manual reboot when there are sensitive interconnecting processes involved, but for a simple server reboot, there’s always a smarter and more practical way to do it and we should try to utilize any tools provided to make life simpler and minimize burn out.
Further Reading
Windows Server: shutdown
How to Delay Shutdown or Restart on a Mac
Leave a Reply