Let's take a look at three different ways to shut down or restart your system. The first is going to be the most commonly employed. The second is still being used by quite a few folks who had to work hard at getting this strange location in their heads during the Windows 8 rollout, and they have continued to use it from that point forward. The third is less commonly known but is by far my favorite when tasked with restarting a remote server.
The first option, thankfully, is in a location that actually makes sense. I say thankfully because when Server 2012 was released, this option didn't exist, and finding the restart function was much more difficult. Just like we have always been able to do prior to the Windows 8 rollout, we can simply click on the Start button and see right there near the bottom that we have Power control options available to us:
Now, when you click on Shut down or Restart, you are asked to supply a reason why you are restarting. Common sense tells us that if you are manually clicking on the Restart button, there is a pretty good chance you are actually intending to restart the server, right? A planned occurrence? But what is the default option that presents itself? Other (Unplanned). Alas, this silly default option is certainly going to cause us log files full of unplanned restarts, even though all of those restarts were actually planned. Because let's be real—nobody takes the time to change that drop-down menu before they click Continue:
The second method to accomplish shutting down or restarting is by right-clicking on the Start button. We will discuss this little menu that is presented when right-clicking on Start in our next recipe, but for the sake of a quick shut down or restart, you can simply right-click on the Start button, and then choose Shut down or sign out:
Each of the previous two examples runs the risk of rebooting the wrong system. Depending on how many layers of remote connections, such as RDP, you are using, it is fairly easy to reboot your own computer or the wrong server instead of the server you intended to reboot, because it is fairly easy to click on the Start button of a different system than the one you intended in the first place. The most definitive, and dare I say the most fun way of restarting your server is to utilize a Command Prompt. Doing this gives you the opportunity to double check that you are manipulating the correct machine. Open up a Command Prompt and run a quick hostname check to make sure you are restarting the one you really intend to. Then utilize the shutdown command to take care of the rest. This process can be especially helpful when logged into remote servers using RDP. Use the following commands to perform the explained operations:
hostname
shutdown /r /t 0
If you were to simply type shutdown, the server would shut itself down in 60 seconds. Using /r indicates a restart rather than a shutdown, and /t 0 is a timing flag that indicates the number of seconds the server should wait before restarting. Specifying slash zero here tells it to wait for zero seconds before initiating the restart: