Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows Server 2012 R2 Administrator Cookbook

You're reading from   Windows Server 2012 R2 Administrator Cookbook Over 80 hands-on recipes to effectively administer and manage your Windows Server 2012 R2 infrastructure in enterprise environments

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784393076
Length 310 pages
Edition 1st Edition
Arrow right icon
Author (1):
Arrow left icon
Jordan Krause Jordan Krause
Author Profile Icon Jordan Krause
Jordan Krause
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Learning the Interface FREE CHAPTER 2. Core Infrastructure Tasks 3. Security and Networking 4. Working with Certificates 5. Internet Information Services 6. Remote Access 7. Remote Desktop Services 8. Monitoring and Backup 9. Group Policy 10. File Services and Data Control Index

Shutting down or restarting the server

I just couldn't resist starting with this one. Yes, this seems trivial. Silly even. However, the amount of times that I have watched a simple server restart consume more mouse clicks than creating a Domain Controller has convinced me that this needed to be in the book. Perhaps the shutdown and restart options were hidden away purposefully, because once your system is up and running, there is not often a need to accomplish either of these tasks. When first configuring the box though, it is very common to have to reboot a couple of times, or to shut down a machine to move it to another location.

Getting ready

To step through this recipe, you will need a Windows Server 2012 R2 system online. There are no other prerequisites.

How to do it...

Let's take a look at three different ways to shut down or restart your system. The first two are the most commonly employed. The third is less commonly known, but is by far my preference when tasked with restarting a remote server.

The first option would be to use the power button on the Start screen. So far, I don't think that many administrators have stumbled into this one, because it didn't exist in Server 2012.

  1. Click on your "Start Button", or rather your button in the Taskbar that opens your Start screen. You will see a power icon in the top-right corner of that Start screen.
  2. Click on this for Shut down and Restart options.
    How to do it...

The second method to accomplish shutting down or restarting is by using the charms bar. The charms bar is the little menu that presents itself when you have your mouse sitting near the upper-right corner of your screen. On a touchscreen computer, you swipe your finger from the right side of the screen toward the middle to make it appear. Go ahead and hover the mouse in the upper-right corner of your screen until the charms bar appears. Then click on Settings, and then on Power. Unfortunately, this is the most common way to attempt to restart a Server 2012 R2 machine. I say unfortunately because it is so easy to hover in the corner and display the wrong charms bar, the one for your own Desktop for example.

Many mistaken reboots are caused by this.

How to do it...

The most definitive, and dare I say most fun way of restarting your server is to utilize Command Prompt. Doing this gives you the opportunity to double check that you are manipulating the correct machine. Open up 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 shut down, 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.

How to do it...

How it works...

Shutting down or restarting a server doesn't require a lot of explanation, but I hope that this small recipe gets some thought going about creative ways to do regular tasks. As you will see throughout this book, you can accomplish anything in Windows Server 2012 R2 through the use of commands or scripts. You could easily turn the shutdown command, the last example that we tested in this recipe, into a batch file, and place it on the Desktop of each of your servers as a quick double-click option for accomplishing this task.

However, I work with RDP windows inside RDP windows very often. When you're bouncing around between a dozen servers that all have the same background, I have decided that the only sure-fire way to make sure you are restarting the correct device is to do a quick hostname check before you initiate the restart. If you are interested in discovering all of the available flags that are available to use with the shutdown command, make sure to type in shutdown /? some time to take a look at all of the available options.

Tip

Using the command prompt is also an easy way to log off a server. Let's say you are layers deep in RDP and want to log off from a single server (not all of them). Are you sure you clicked on the Start button of the right server? Instead, open up a prompt and simply type Logoff.

You have been reading a chapter from
Windows Server 2012 R2 Administrator Cookbook
Published in: Jan 2015
Publisher:
ISBN-13: 9781784393076
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime