Windows Server 2016 Cookbook - Jordan Krause - E-Book

Windows Server 2016 Cookbook E-Book

Jordan Krause

0,0
50,39 €

-100%
Sammeln Sie Punkte in unserem Gutscheinprogramm und kaufen Sie E-Books und Hörbücher mit bis zu 100% Rabatt.

Mehr erfahren.
Beschreibung

Saute your way through more than 100 hands-on recipes designed to prepare any server administrator to work with Windows Server 2016

About This Book

  • Get the first book on the market to unleash the power of Windows Server 2016, which improves the lives of thousands of enterprise users
  • Be the first to leverage the advent of Containers and Nano Server on Windows Server 2016, which utilizes the resources efficiently and increases productivity.
  • This practical, recipe-based approach helps you to delivering global-scale cloud services into your infrastructure using Windows Server 2016

Who This Book Is For

This book is for system administrators and IT professionals with experience in Windows Server 2012 R2 environments who are looking to acquire the skills and knowledge necessary to manage and maintain the core infrastructure required for a Windows Server 2016 environment.

What You Will Learn

  • Build the infrastructure required for a successful Windows network
  • Navigate the new Server 2016 interface efficiently
  • Implement solid networking and security practices into your Windows Server environment
  • Design your own PKI and start issuing certificates today
  • Explore the brand-new Nano Server functionality
  • Enable nested virtualization on Hyper-V and Server
  • Connect your remote laptops back to the corporate network using Microsoft's own remote access technologies, including DirectAccess
  • Provide a centralized point for users to access applications and data by configuring Remote Desktop Services
  • Compose optimal Group Policies
  • Facilitate task automation with PowerShell 5.0 scripting

In Detail

This hands-on Cookbook is stuffed full of practical recipes that will help you handle the essential administrative tasks in Windows Server 2016. You'll start by familiarizing yourself with the look and feel of Windows Server 2016, and will then learn how to navigate through some daily tasks using the graphical interface. You will see how to compose optimal Group Policies and facilitate task automation with PowerShell 5.0 scripting. We will also take a look at the functions available to provide remote network access to your traveling users, and explore the much anticipated Nano Server and Hyper-V built-in integration support that is brand new in Windows Server 2016.

By the end of this book, you will know how to take your Windows Server 2016-powered server and turn it into any common infrastructure role that might be required in your company.

Style and approach

The book follows a recipe-based approach that starts with an introduction and the installation of Windows Server 2016, then dives into the powerful features, and then ends with the concept of security.

Sie lesen das E-Book in den Legimi-Apps auf:

Android
iOS
von Legimi
zertifizierten E-Readern

Seitenzahl: 494

Veröffentlichungsjahr: 2016

Bewertungen
0,0
0
0
0
0
0
Mehr Informationen
Mehr Informationen
Legimi prüft nicht, ob Rezensionen von Nutzern stammen, die den betreffenden Titel tatsächlich gekauft oder gelesen/gehört haben. Wir entfernen aber gefälschte Rezensionen.



Table of Contents

Windows Server 2016 Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Errata
Piracy
Questions
1. Learning the Interface
Introduction
Shutting down or restarting the server
Getting ready
How to do it…
How it works…
Launching Administrative Tools
Getting ready
How to do it…
How it works…
Using WinKey + X for quick admin tasks
Getting ready
How to do it…
How it works…
Using the search function to launch applications quickly
Getting ready
How to do it…
How it works…
Managing remote servers from a single pane with Server Manager
Getting ready
How to do it…
How it works…
See also
Using PowerShell to accomplish any function in Windows Server
Getting ready
How to do it…
How it works…
Installing a role or feature
Getting ready
How to do it…
How it works…
Administering Server 2016 from a Windows 10 machine
Getting ready
How to do it…
How it works…
See also
Identifying useful keyboard shortcuts in Server 2016
Getting ready
How to do it…
How it works…
Setting your PowerShell Execution Policy
Getting ready
How to do it…
How it works…
Building and executing your first PowerShell script
Getting ready
How to do it…
How it works…
Searching for PowerShell cmdlets with Get-Help
Getting ready
How to do it…
How it works…
2. Core Infrastructure Tasks
Introduction
Configuring a combination Domain Controller, DNS server, and DHCP server
Getting ready
How to do it…
How it works…
See also
Adding a second Domain Controller
Getting ready
How to do it…
How it works…
Organizing your computers with Organizational Units
Getting ready
How to do it…
How it works…
Creating an A or AAAA record in DNS
Getting ready
How to do it…
How it works…
See also
Creating and using a CNAME record in DNS
Getting ready
How to do it…
How it works…
See also
Creating a DHCP scope to assign addresses to computers
Getting ready
How to do it…
How it works…
Creating a DHCP reservation for a specific server or resource
Getting ready
How to do it…
How it works…
Pre-staging a computer account in Active Directory
Getting ready
How to do it…
How it works…
Using PowerShell to create a new Active Directory user
Getting ready
How to do it…
How it works…
See also
Using PowerShell to view system uptime
Getting ready
How to do it…
How it works…
3. Security and Networking
Introduction
Requiring complex passwords in your network
Getting ready
How to do it…
How it works…
Using Windows Firewall with Advanced Security to block unnecessary traffic
Getting ready
How to do it…
How it works…
Changing the RDP port on your server to hide access
Getting ready
How to do it…
How it works…
Multi-homing your Windows Server 2016
Getting ready
How to do it…
How it works…
See also
Adding a static route into the Windows routing table
Getting ready
How to do it…
How it works…
Using Telnet to test a connection and network flow
Getting ready
How to do it…
How it works…
Using the Pathping command to trace network traffic
Getting ready
How to do it…
How it works…
Setting up NIC Teaming
Getting ready
How to do it…
How it works…
Renaming and domain joining via PowerShell
Getting ready
How to do it…
How it works…
See also
Building your first Server Core
Getting ready
How to do it…
How it works…
See also
4. Working with Certificates
Introduction
Setting up the first Certification Authority server in a network
Getting ready
How to do it…
How it works…
See also
Building a Subordinate Certification Authority server
Getting ready
How to do it…
How it works…
See also
Creating a certificate template to prepare for issuing machine certificates to your clients
Getting ready
How to do it…
How it works…
Publishing a certificate template to allow enrollment
Getting ready
How to do it…
How it works…
Using MMC to request a new certificate
Getting ready
How to do it…
How it works…
Using the web interface to request a new certificate
Getting ready
How to do it…
How it works…
Configuring Autoenrollment to issue certificates to all domain joined systems
Getting ready
How to do it…
How it works…
Renewing your root certificate
Getting ready
How to do it…
How it works…
5. Internet Information Services
Introduction
Installing the Web Server role with PowerShell
Getting ready
How to do it…
How it works…
See also
Launching your first website
Getting ready
How to do it…
How it works…
Changing the port on which your website runs
Getting ready
How to do it…
How it works…
Adding encryption to your website
Getting ready
How to do it…
How it works…
Using a Certificate Signing Request to acquire your SSL certificate
Getting ready
How to do it…
How it works…
Moving an SSL certificate from one server to another
Getting ready
How to do it…
How it works…
Rebinding your renewed certificates automatically
Getting ready
How to do it…
How it works…
Hosting multiple websites on your IIS server
Getting ready
How to do it…
How it works…
Using host headers to manage multiple websites on a single IP address
Getting ready
How to do it…
How it works…
6. Remote Access
Introduction
DirectAccess planning question and answers
Configuring DirectAccess, VPN, or a combination of the two
Getting ready
How to do it…
How it works…
Pre-staging Group Policy Objects to be used by DirectAccess
Getting ready
How to do it…
How it works…
Enhancing the security of DirectAccess by requiring certificate authentication
Getting ready
How to do it…
How it works…
Building your Network Location Server on its own system
Getting ready
How to do it…
How it works…
Enabling Network Load Balancing on your DirectAccess servers
Getting ready
How to do it…
How it works…
Adding VPN to your existing DirectAccess server
Getting ready
How to do it…
How it works…
Replacing your expiring IP-HTTPS certificate
Getting ready
How to do it…
How it works…
Reporting on DirectAccess and VPN connections
Getting ready
How to do it…
How it works…
7. Remote Desktop Services
Introduction
Building a single server Remote Desktop Services environment
Getting ready
How to do it…
How it works…
Adding an additional RDSH server to your RDS environment
Getting ready
How to do it…
How it works…
Installing applications on a Remote Desktop Session Host server
Getting ready
How to do it…
How it works…
Disabling the redirection of local resources
Getting ready
How to do it…
How it works…
Shadowing another session in RDS
Getting ready
How to do it…
How it works…
Installing a printer driver to use with redirection
Getting ready
How to do it…
How it works…
Removing an RD Session Host server from use for maintenance
Getting ready
How to do it…
How it works…
Publishing WordPad with RemoteApp
Getting ready
How to do it…
How it works…
Tracking user logins with Logon/Logoff scripts
Getting ready
How to do it…
How it works…
8. Monitoring and Backup
Introduction
Using Server Manager as a quick monitoring tool
Getting ready
How to do it…
How it works…
Using the new Task Manager to its full potential
Getting ready
How to do it...
How it works…
Evaluating system performance with Windows Performance Monitor
Getting ready
How to do it…
How it works…
Using Format-List to modify PowerShell data output
Getting ready
How to do it…
How it works…
Configuring a full system backup using Windows Server Backup
Getting ready
How to do it...
How it works…
Recovering data from a Windows backup file
Getting ready
How to do it…
How it works…
Using IP Address Management to keep track of your used IP addresses
Getting ready
How to do it…
How it works…
Checking for viruses in Windows Server 2016
Getting ready
How to do it…
How it works…
9. Group Policy
Introduction
Creating and assigning a new Group Policy Object
Getting ready
How to do it…
How it works…
Mapping network drives with Group Policy
Getting ready
How to do it…
How it works…
Redirecting the My Documents folder to a network share
Getting ready
How to do it…
How it works…
Creating a VPN connection with Group Policy
Getting ready
How to do it…
How it works…
Creating a printer connection with Group Policy
Getting ready
How to do it…
How it works…
Using Group Policy to enforce an Internet proxy server
Getting ready
How to do it…
How it works…
Viewing the settings currently enabled inside a GPO
Getting ready
How to do it…
How it works…
See also
Viewing the GPOs currently assigned to a computer
Getting ready
How to do it…
How it works…
See also
Backing up and restoring GPOs
Getting ready
How to do it…
How it works…
See also
Plugging in ADMX and ADML templates
Getting ready
How to do it…
How it works…
10. File Services and Data Control
Introduction
Enabling Distributed File System and creating a Namespace
Getting ready
How to do it…
How it works…
Configuring Distributed File System Replication
Getting ready
How to do it…
How it works…
Creating an iSCSI target on your server
Getting ready
How to do it…
How it works…
See also
Configuring an iSCSI initiator connection
Getting ready
How to do it…
How it works…
Configuring Storage Spaces
Getting ready
How to do it…
How it works…
See also
Storage Spaces Direct
Storage Replica
Turning on data deduplication
Getting ready
How to do it…
How it works…
See also
Setting up Windows Server 2016 work folders
Getting ready
How to do it…
How it works…
See also
11. Nano Server and Server Core
Introduction
Configuring Server Core from the console
Getting ready
How to do it…
How it works…
Switching between Server Core and Desktop Experience?
Getting ready
How to do it…
How it works…
Building your first Nano Server
Getting ready
How to do it…
How it works…
See also
Nano Server Image Builder
Exploring the Nano Server console
Getting ready
How to do it…
How it works…
Managing Nano and Core with Server Manager
Getting ready
How to do it…
How it works…
Managing Nano and Core using remote MMC tools
Getting ready
How to do it…
How it works…
Managing Nano and Core with PowerShell remoting
Getting ready
How to do it…
How it works…
See also
12. Working with Hyper-V
Introduction
Creating a Windows Server that runs Hyper-V
Getting ready
How to do it…
How it works…
Creating a Hyper-V Server
Getting ready
How to do it…
How it works…
Networking your VMs
Getting ready
How to do it…
How it works…
Building your first virtual machine
Getting ready
How to do it…
How it works…
Using the VM Settings page
Getting ready
How to do it…
How it works…
Editing virtual hard disks
Getting ready
How to do it…
How it works…
Using Checkpoints as rollback points
Getting ready
How to do it…
How it works…

Windows Server 2016 Cookbook

Windows Server 2016 Cookbook

Copyright © 2016 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.

First published: January 2015

Second edition: November 2016

Production reference: 1151116

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham 

B3 2PB, UK.

ISBN 978-1-78588-383-5

www.packtpub.com

Credits

Author

Jordan Krause

Copy Editors

Vikrant Phadke

Safis Editing

Reviewer

Florian Klaffenbach

Project Coordinator

Nidhi Joshi

Commissioning Editor

Pratik Shah

Proofreader

Safis Editing

Acquisition Editor

Vinay Argekar 

Indexer

Aishwarya Gangawane 

Content Development Editor

Mayur Pawanikar

Graphics

Disha Haria

Technical Editor

Mohita Vyas

Production Coordinator

Nilesh Mohite

About the Author

Jordan Krause is a Microsoft MVP in the Cloud and Datacenter Management - enterprise security group. He has had the unique opportunity to work with the Microsoft networking technologies daily as a senior engineer at IVO Networks. Jordan specializes in Microsoft DirectAccess, and has authored one of the only books available worldwide on this subject. Additional writings include books on Windows Server 2012 R2 Administrative Cookbook and the new Windows Server 2016 Cookbook, both by Packt Publishing. He spends the majority of each workday planning, designing, and implementing DirectAccess and VPN solutions for companies around the world. Committed to continuous learning, Jordan holds Microsoft certifications as an MCP, MCTS, MCSA, and MCITP Enterprise Administrator. He regularly writes tech notes and articles reflecting his experiences with the Microsoft networking technologies; these can be found at: http://www.ivonetworks.com/news.

Jordan also strives to spend time helping the DirectAccess community, mostly by way of the Microsoft TechNet forums. Always open to direct contact, he encourages anyone who needs assistance to head over to the forums and find him personally. Jordan lives and works in the ever-changing climate, that is, Michigan.

About the Reviewer

Florian Klaffenbach started his IT carrier in 2004 as a first- and second-level IT support technician and IT salesman trainee for a B2B online shop. After that he changed to a small company working as an IT project manager for planning, implementing, and integration from industrial plants and laundries into enterprise IT. After spending some years, he joined Dell Germany. There he started from scratch as an enterprise technical support analyst and later worked on a project to start Dell technical Communities and support over social Media in Europe and outside of the U.S. Currently he is working as a solutions architect and consultant for Microsoft Infrastructure and cloud, specialized in Microsoft Hyper-V, Fileservices, System Center Virtual Machine Manager, and Microsoft Azure IaaS.

Additionally, he is an active Microsoft blogger and lecturer. He blogs for example on his own page at Datacenter-Flo.de or Brocade Germany Community. Together with a very good friend, he founded the Windows Server User Group Berlin to create a network of Microsoft IT Pros in Berlin. Florian is maintaining a very tight network to many vendors such as Cisco, Dell, and Microsoft as well as communities. That helps him to grow his experience and to get the best out of a solution for his customers. Since 2016 he is also a co-chairman of the Azure Community Germany. In April 2016, Microsoft awarded Florian the Microsoft Most Valuable Professional for Cloud and Datacenter Management.

He has worked for several companies such as Dell Germany, CGI Germany, and his first employer, TACK GmbH. Currently, he is working at MSG service AG as a senior consultant of Microsoft cloud infrastructure.

Here are some of the books that he has worked on: Taking Control with System Center App Controller, Microsoft Azure Storage Essentials, Mastering Microsoft Azure Development, and Mastering Microsoft Deployment Toolkit 2013, all by Packt Publishing.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.

https://www.packtpub.com/mapt

Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

Fully searchable across every book published by PacktCopy and paste, print, and bookmark contentOn demand and accessible via a web browser

Preface

Microsoft is the clear leader of server racks in enterprise data centers across the globe. Walk into any backroom or data center of any company and you are almost guaranteed to find the infrastructure of that organization being supported by the Windows Server operating system. We have been relying on Windows Server for more than 20 years, and rightfully so-–nowhere else can you find such an enormous mix of capabilities all provided inside one installer disc. Windows Server 2016 continues to provide the core functionality that we have come to rely upon from all previous versions of Windows Server, but in better and more efficient ways. On top of that, we have some brand new capabilities in Server 2016 that are particularly mind-bending, new ways to accomplish more efficient and secure handling of our network traffic and data.

There is a relevant question mixed into all this server talk, “We hear so much about the cloud. Isn’t everyone moving to the cloud? If so, why would we even need Windows Server 2016 in our company?” There are two different ways to answer this question, and both result in having huge benefits to knowing and understanding this newest version of Windows Server. First, there really aren’t that many companies moving all of their equipment into the cloud. In fact, I have yet to meet any business with more than 10 employees who has gone all-in for the cloud. In almost all cases, it still makes sense that you would use at least one on premise server to manage local user account authentication, or DHCP, or print services, or for a local file server–-the list goes on and on. Another reason companies aren’t moving to the cloud like you might think they are is security. Sure, we might throw some data and some user accounts to the cloud to enable things like federation and ease of accessing that data, but what about sensitive or classified company data? You don’t own your data if it resides in the cloud – you don’t even have the capability to manage the backend servers that are actually storing that data alongside data from other companies. How can you be guaranteed of your data’s security and survival? The ultimate answer is that you cannot. And this alone keeps many folks that I have talked to away from moving all of their information to the cloud. The second reason it is still important to build knowledge on the Windows Server platform is that even if you have made the decision to move everything to the cloud, what server platform will you be running in the cloud that you now have to log into and administer? If you are using Azure for cloud services, there is a very good chance that you will be logging into Windows Server 2016 instances in order to administer your environment, even if those Server 2016 boxes are sitting in the cloud. So whether you have on premise servers, or you are managing servers sitting in the cloud somewhere, learning all you can about the new Windows Server 2016 operating system will be beneficial to your day job in IT.

When I first learned of the opportunity to put together this book, it was a difficult task to assemble an outline of possible recipes. Where to begin? There are so many different roles that can be run in Windows Server 2016, and so many tasks within each role that could be displayed. It was a natural reaction to start looking for all of the things that are brand new in Server 2016, and to want to talk only about recipes that display the latest and greatest features. But then I realized that those recipes on their own won’t accomplish anything helpful for someone who is trying to learn about Windows Server administration for the first time. It is critical that we provide a base understanding of the important infrastructural roles that are commonly provided by Windows Server, because without that baseline the newest features won’t amount to a hill of beans.

So my hope is that you find a pleasant mix of both in this volume. There are recipes that tackle the core infrastructure tasks that we have been performing in previous versions of Windows Server, but now focusing on how to make them work in the new Windows Server 2016. Then we mix those core tasks with recipes that display some of the brand new features provided in 2016 that enhance the standard roles and services. Some recipes are clearly for the beginner, while others get deeper into the details so that someone already experienced with working inside Windows Server will gain some new knowledge out of reading this book. We will discuss the roles that are critically important to making any Microsoft network function: Active Directory, DNS, DHCP, certificate services, and so on. Then we will also bring some light to the new functions inside Windows Server 2016 like Nano Server and Storage Spaces Direct.

A primary goal of this cookbook is to be a reference guide that you can come back to time and again when you need to accomplish common tasks in your environment, but want to ensure that you are performing them the right way. I hope that through these chapters you are able to become comfortable enough with Windows Server 2016 that you will go out and install it today!

What this book covers

Chapter 1, Learning the Interface, starts us on our journey working with Windows Server 2016 as we figure out how to navigate the look and feel of this new operating system, and gain some tips and tricks to make our daily chores more efficient.

Chapter 2, Core Infrastructure Tasks, takes us through configuring and working with the core Microsoft technology stack. The recipes contained in this chapter are what I consider essential knowledge for any administrator who intends to work in a Windows network.

Chapter 3, Security and Networking, teaches us some methods for locking down access on our servers. We will also cover commands which can be very useful tools as you start monitoring network traffic.

Chapter 4, Working with Certificates, will start to get us comfortable with the creation and distribution of certificates within our network. PKI is an area that is becoming more and more prevalent, but the majority of server administrators have not yet had an opportunity to work hands-on with them.

Chapter 5, Internet Information Services, brings us into the configuration of a Windows Server 2016 box as a web server in our network. Strangely, in the field, I find a lot of Microsoft networks with Apache web servers floating around. Let’s explore IIS as a better alternative.

Chapter 6, Remote Access, digs into using your Server 2016 as the connectivity platform which brings your remote computers into the corporate network. We discuss DirectAccess and VPN in this chapter.

Chapter 7, Remote Desktop Services, encourages you to look into using Server 2016 as a virtual session host or VDI solution. RDS can be an incredibly powerful tool for anyone interested in centralized computing.

Chapter 8, Monitoring and Backup, covers some of the capabilities included with Server 2016 to help keep tabs on the servers running in your infrastructure. From monitoring system performance and IP address management to backing up and restoring data using the tools baked into Windows, these recipes will walk you through some helpful tasks related to monitoring and backup.

Chapter 9, Group Policy, takes us into the incredibly powerful and far reaching management powers contained within Active Directory that are provided out of the box with Windows Server 2016.

Chapter 10, File Services and Data Control, provides us with information and step-by-step recipes on some of the lesser known ways that data can be managed on a Windows server. We will cover technologies like DFSR, iSCSI, and Server 2016 Work Folders. Also included is information about the new Storage Spaces Direct, and Storage Replica.

Chapter 11, Nano Server and Server Core, encourages us to shrink our servers! Most of us automatically deploy all of our servers with the full graphical interface, but often times we could make our servers more efficient and more secure by using one of the headless interfaces. Let’s explore these capabilities together to see where they can fit into your environment.

Chapter 12, Working with Hyper-V, takes a look into the backend interface of our virtualization infrastructure. Many server administrators only ever access their virtual machines as if they were physical servers, but there may come a day when you need to get into that backend administration and create a new VM or adjust some settings.

What you need for this book

All the technologies and features that are discussed in the recipes of this book are included with Windows Server 2016! As long as you have access to the operating system installer disc and either a piece of hardware or a virtualization environment where you can spin up a new virtual machine, you will be able to install the operating system and follow along with our lessons.

Many of the tasks that we are going to accomplish together require a certain amount of base networking and infrastructure to be configured, in order to fully test the technologies that we are working with. The easiest method to working through all of these recipes will be to have access to a Hyper-V server upon which you can build multiple virtual machines that run Windows Server 2016. With this available, you will be able to build recipe upon recipe as we move through setting up the core infrastructure tasks, and then utilize those same servers to build upon in the later recipes. Building a baseline lab network running Server 2016 for the Microsoft infrastructure roles like Active Directory, DNS, DHCP, certificates, and web/file services will help you tremendously as you move throughout this book. If you are not familiar with building out a lab, do not be dismayed. Many of the recipes included here will help with building the structure of the lab itself.

Who this book is for

This book is for system administrators and IT professionals that may or may not have previous experience with Windows Server 2012 R2 or its predecessors. Since the start of this book, I have been contacted and asked many times whether the core, baseline information to beginning to work with Windows Server will be included. These requests have come from current desktop administrators wanting to get into the server world, and even from developers hoping to better understand the infrastructure upon which their applications run. Both will benefit from the information provided here. Anyone hoping to acquire the skills and knowledge necessary to manage and maintain the core infrastructure required for a Windows Server 2016 environment should find something interesting on the pages contained within.

Sections

In this book, you will find several headings that appear frequently (Getting ready, How to do it, How it works, There's more, and See also).

To give clear instructions on how to complete a recipe, we use these sections as follows.

Getting ready

This section tells you what to expect in the recipe, and describes how to set up any software or any preliminary settings required for the recipe.

How to do it…

This section contains the steps required to follow the recipe.

How it works…

This section usually consists of a detailed explanation of what happened in the previous section.

There's more…

This section consists of additional information about the recipe in order to make the reader more knowledgeable about the recipe.

See also

This section provides helpful links to other useful information for the recipe.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Then utilize the shutdown command to take care of the rest."

A block of code is set as follows:

Param( [Parameter(Mandatory=$true)][string]$ServerName )

Any command-line input or output is written as follows:

hostname shutdown /r /t 0

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Click on Tools in the upper-right corner."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors .

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.

Chapter 1. Learning the Interface

In an effort to become familiar with the look and feel of Windows Server 2016, you will learn how to navigate through some daily tasks using the graphical interface. On our agenda in this chapter are the following recipes:

Shutting down or restarting the serverLaunching Administrative ToolsUsing WinKey + X for quick admin tasksUsing the search function to launch applications quicklyManaging remote servers from a single pane with Server ManagerUsing PowerShell to accomplish any function in Windows ServerInstalling a role or featureAdministering Server 2016 from a Windows 10 machineIdentifying useful keyboard shortcuts in Server 2016Setting your PowerShell Execution PolicyBuilding and executing your first PowerShell scriptSearching for PowerShell cmdlets with Get-Help

Introduction

Windows 8 and Server 2012 brought us a drastic change in the way that we interfaced with the Windows operating system, and most of us didn't think that change was for the better. By now I assume you have all seen, used, and are hopefully deploying Windows 10 on your client computers, which brings some relief with regard to the user interface. With Windows 10 we have kind of a mix between Windows 7 and Windows 8, and it fits the needs of most people in a better way. Just like the last couple of rollouts of the Microsoft Windows operating systems, the Server platform follows on the heels of the Desktop version, and the look and feel of Windows Server 2016 is very much like Windows 10. In fact, I would say that Windows 10 and Windows Server 2016 are more alike than the Windows 7/Server 2008 combination or the Windows 8/Server 2012 combination.

If you have been using Windows 10, you already have a good head start for successfully interfacing with Windows Server 2016. However, if you are still using older equipment and haven't had a chance to really dive into the latest and greatest operating systems, these big changes in the way that we interact with our servers can be a big stumbling block to successfully utilizing the new tools. Many differences exist when comparing Server 2016 to something like Server 2008, and when you are working within three levels of Remote Desktop Protocol (RDP), bouncing from one server to another, all of these little differences are compounded. It suddenly becomes difficult to know which server it is that you are working on or changing. Let's have a show of hands, how many of you have mistakenly rebooted the wrong server? Or even more likely, how many of you have rebooted your own computer while you were trying to reboot a remote server? I know I have! And not just once.

Hope is not lost! I promise you that, once you learn to manage the interface, rather than letting it manage you, some of these changes may start to seem like good ideas. They can increase productivity and the ease of accomplishing tasks—we just need some pointers on making the best use of the new interface.

The recipes in this chapter are dedicated to doing just that. Let's work together to gain a better understanding of why the interface was built the way it is, and learn to take advantage of these new screens and settings.

Shutting down or restarting the server

I just couldn't resist starting with this one. Yes, this seems trivial. Silly even. However, the number 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 time or to shut down a machine to move it to another location. Let's face it, it doesn't seem to matter how many years computers have been around, many times the magical reboot is still the fix—all answer to most problems, even if we have no idea why.

Getting ready

To go through this recipe, you will need a Windows Server 2016 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 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 had 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 dropdown 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.

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 2016 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 image, 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 /? sometime 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.

Launching Administrative Tools

Earlier versions of Windows Server placed all of the Administrative Tools in a self-named folder right inside the Start menu. This was always a quick and easy place to visit in order to see all of the Administrative Tools installed onto a particular server. This location for the tools disappeared as of Server 2012, because of the infamous Start Screen. I am glad to say that a more traditional-looking Start menu has returned in Windows Server 2016, and inside it once again is a link to the Windows Administrative Tools. However, as you also know there is this thing called Server Manager that loves to present itself every time that you log in to a server. Since Server Manager is already on your screen most of the time anyway, it is actually the fastest way to launch these Administrative Tools that you need to utilize so often. Let's take a look at launching your commonly used infrastructure tools right from inside the Server Manager interface.

Getting ready

All you really need is a Windows Server 2016 machine online. The more roles and services that you have running on it, the more options that you will see on your screen as we navigate these menus.

How to do it…

To launch Administrative Tools from your Desktop, perform the following steps:

Open up Server Manager. In fact, if you just logged into the server, it's probably already open for you.Click on Tools in the upper-right corner.

There you go. A full list of all the Administrative Tools installed onto that server. Heading into this list is also a quick way of taking a look into what a particular server is doing, which you can take an educated guess at based on what roles and services are installed. By looking at the following screenshot, we can see that this server appears to be a domain controller that is also running DNS and DHCP, because all of the related tools are available to choose in this list. That is accurate, as this is my DC1 domain controller server. It is important to note that your server may be running components that do not show up in this list. For example, if you install a role via PowerShell and do not enter the parameter to also install the management tools for that role, it is possible that you could have a server where the role is up and running, but the management tools simply have not been installed. In that case, those tools would not show up in this list.

How it works…

Since Server Manager likes to open automatically when logging in, let's make quick use of it to open the tools that we need to do our jobs. Another way to have easy access to your tools from the Desktop is to create shortcuts or to pin each of them to your taskbar. Sometimes this isn't as easy as it sounds. In the past, these tools were all grouped together in the Administrative Tools folder, so you didn't have any reason to memorize the exact names of the tools. While you can access them that way again in Server 2016, that folder may or may not appear inside the Start menu depending on how the server is configured, because it appears as one of the live tiles. If you click on the Start button, you could try using the search function to find the tool you are looking for, but its name may not immediately come to you. If you're a consultant working on someone else's server, you may not want to pin anything to their Desktop anyway, and you certainly don't want to resort to using Bing in front of them to look up the name of the tool. So I like to stick with launching Administrative Tools from Server Manager since it always exists, and the tools will always be available inside that menu.

Using WinKey + X for quick admin tasks

There are some functions in Windows that a server administrator needs to use all the time. Instead of making shortcuts or pinning them all to the taskbar, let's get to know this hidden menu, which is extremely useful for launching these commonly used admin tools.

Getting ready

A running Windows Server 2016 machine is all we need to highlight this one. In fact, this menu also exists on any Windows 10 computer, so make use of it often!

How to do it…

There are two ways to open this little menu. While you are in the Server 2016 Desktop, you can perform either of these steps:

Hold down your Windows key (WinKey) on the keyboard and press X.Hover your mouse over the Windows flag in the lower-left corner of the Desktop—the Start button—when you right-click on that button you will see a menu, shown in the following screenshot:

How it works…

This little quick-tasks admin menu is very easy to open and is very convenient for launching programs and settings that are accessed often. I won't talk too much about what particulars are in the menu as it's pretty self-explanatory, but I use this menu multiple times per day to open up the System properties and the Command Prompt, as it has an option to open an administrative Command Prompt right from the menu.

Tip

Look at that, you can also shut down the server from here!

Using the search function to launch applications quickly

The Start screen in Windows Server 2012 was not the greatest idea to come out of Microsoft, and unfortunately what it did was train people to no longer click on the Start button, so that we didn't have to deal with the Start screen. Windows 10, and therefore Windows Server 2016, have moved back to a more traditional Start menu, but it is going to take a little bit of time to retrain ourselves to make use of it on a daily basis. I know it will for myself, anyway. Ever since Windows 7 was released, I have been using the Start menu for one critical function in my daily workflow: searching. Let's explore the search capabilities of Server 2016, which can be accessed with a single press of a button.

Getting ready

For this recipe, you will need a Windows Server 2016 system online.

How to do it…

There are two quick ways that you can search inside Server 2016, and they are right next to each other. If you take a look in the lower-left corner of your screen inside the taskbar, you will see a little magnifying glass next to the Start button. Looks like a search function to me. Click on that button, and you can start typing the name of whatever you would like to search for. In the following screenshot, you can see that I have clicked on my magnifying glass and typed cmd in order to find the Command Prompt application.

Search results are presented at the top of that screen, and you can choose what you are looking for accordingly. This is a quick, easy search—but I'm not a fan of it because I don't like using my mouse unless I have to. Grabbing my mouse in order to click on the magnifying glass slows down what I'm trying to do while my hands are on the keyboard, so let's take a look at a faster way to search. No matter where you are in Windows Server 2016, no matter what applications you have open, you can always press the WinKey on your keyboard to open up the Start menu, right? What you may not know is that as soon as your Start menu is open, you can immediately start typing anything in order to search for it. If you need to open Command Prompt, press WinKey and type cmd. If you need to search for a document called Text1, press WinKey and type Text1. I employ this method of opening applications all day every day. This way I don't have to pin anything, I don't have to create any shortcuts, and most importantly, I don't have to use my mouse in order to launch applications.

How it works…

From the Start menu, we can search for anything on the server. This gives us the ability to quickly find and launch any program or application that we have installed. This includes Administrative Tools. Rather than moving into Server Manager in order to launch your administrative consoles from the Tools menu, you can also search for them on the Search menu, and launch from there. It also gives us the ability to find files or documents by name. Another powerful way to use the search function in Windows Server 2016 is to open any kind of setting that you might want to change. In previous versions of Windows, you had to either memorize the way to get into the settings that you wanted to change or you had to open up Control Panel, where you had to poke and prod your way around until you stumbled upon the one that you were looking for. Now it is a very simple matter of pressing the Windows key, typing the first few characters of the setting or program you want to launch, and pressing Enter.

Another common task to perform from the Search screen is to right-click on the application that you are trying to launch and pin it somewhere. When you right-click on a program from the Search screen, you see options to pin the program to either your Start menu or to the taskbar. This will create a quick-launch shortcut on either the main Start menu or on the taskbar of the Desktop mode, giving you easier and faster access to launch those applications in the future.

Managing remote servers from a single pane with Server Manager

As you have already noticed, Server Manager has changed significantly over the past couple of versions of Windows Server. Part of these changes are a shift in mindset where the emphasis is now placed on remote management of servers. Server Manager in Windows Server 2016 can be used to manage and administer multiple systems at the same time, all from your single pane of glass, the monitor where you are sitting. In this recipe, you are going to learn how to manage both the local server we are logged into, as well as a remote server, from the same Server Manager window.

Getting ready

For this recipe, we need two servers. One is the machine we are physically logged into. Another is a server on the same network that we can contact from our primary server so that we can manage it from our local Server Manager.

How to do it…

To manage a local as well as a remote server from the same Server Manager window, perform the following instructions:

Log in to your primary server and launch Server Manager. You will see in the upper-left corner that the only server you have listed is the Local Server that we are logged into.Now head over toward the top-right of Server Manager and click on the Manage button. In this menu, click on Add Servers.If your servers are part of a domain, finding remote machines to manage is very easy by simply selecting them from the default Active Directory tab. If they are not yet joined to your domain, you simply click over to the tab labeled DNS and search for them from that screen.After adding the servers that you want to manage, if you go ahead and click on All Servers in the left window pane, you will see the additional servers listed that you have selected. If you double-click or right-click on those remote server names, you have many options available to you to remotely manage those machines without having to log into them.

Tip

Note that certain servers could resist being manipulated in this way. It is possible to restrict remote management on servers through Group Policy. If that has been done in your environment, you may find that remotely administering them from a centralized console is not possible, and you would have to lift those restrictions on your servers.

How it works…

Server Manager makes use of the Windows Remote Management (WinRM) tools to remotely manipulate servers. Historically, most of us who administer Windows Servers make extensive use of RDP, often having many windows and connections open simultaneously. This can cause confusion and can lead to tasks being accomplished on servers for which they are not intended. By using Server Manager from a single machine to manage multiple servers in your network, you will increase your administrative efficiency as well as minimize human error by having all management happen from a single pane of glass.

This recipe is written with the most common network scenario in mind, which is a domain environment where both servers have been joined to the domain. If you are working with standalone servers that are part of a workgroup, rather than being joined to a domain, you will have some additional considerations. In the workgroup scenario, WinRM will need to be enabled specifically, and the Windows Firewall will have to be adjusted in order to allow the right ports and protocols for that WinRM traffic flow to happen successfully. In general, though, most of you will be working within a Microsoft domain network, in which case these items are not necessary.

See also

The Administering Server 2016 from a Windows 10 machine recipe

Using PowerShell to accomplish any function in Windows Server

An incredibly powerful tool in Windows Server 2016 is PowerShell. Think of PowerShell like a Command Prompt on steroids. It is a command-line interface from which you can manipulate almost anything inside Windows that you may care to. Better yet, any task that you may wish to accomplish can be scripted out in PowerShell and saved off as a .ps1 script file, so that you can automate large tasks and schedule them for later, or at regular intervals. In this recipe, let's open up PowerShell and run some sample commands and tasks just to get a quick feel for the interface. In a later chapter of the book, we will do some more specific tasks with PowerShell to go even deeper into the technology.

Getting ready

To start using PowerShell, all you need is a server with Windows Server 2016 installed. PowerShell is installed and enabled by default.

How to do it…

To get a feel of using PowerShell, perform the following steps:

PowerShell used to exist in the taskbar by default, which was smart because we really should be pushing people to use it rather than Command Prompt, right? Unfortunately, PowerShell is not in the taskbar by default in Server 2016, but the Windows Store is...? Explain that one to me some day. So our first step to working in PowerShell is finding it. Thankfully, we know how to search for applications now, so I'll just press my WinKey and type PowerShell. Once my search result is displayed, I am going to right-click on Windows PowerShell and choose to Run as administrator.Test out some commands that you are familiar with from using the Command Prompt, such as dir and cls. Since you are able to make use of these familiar commands, PowerShell can really be your one and only command-line interface if you choose.Now let's try some of the PowerShell secret sauce, one of its cmdlets. These are special commands that are built into Windows and allow us to do all kinds of information gathering, as well as manipulation of server components. Let's start by pulling some data. Maybe take a look at what IP addresses are on the system with Get-NetIPAddress.The previous command probably gave you a lot more information than you needed, since most companies don't make use of IPv6 inside their network yet. Let's whittle this information down to the IPv4-specific info that you are most likely interested in. Enter Get-NetIPAddress -AddressFamily IPv4 to attain it.

How it works…

PowerShell has so many commands and cmdlets, we just wanted to get a feel for launching the program and pulling some data with this particular recipe. There are countless Get commands to query information from the server, and as you have seen those cmdlets have various parameters that can be appended to the cmdlets to pull more specific data to meet your needs. To make things even better, there are not only Get cmdlets, but also Set cmdlets, which will allow us to make use of the PowerShell prompt to configure many aspects of the configuration on our server, as well as remote servers. We will dive further into PowerShell in a later chapter.

Installing a role or feature

You've installed the Windows Server 2016 operating system onto a piece of hardware. Great! Now what? Without adding roles and features to your server, it makes a great paper weight. We're going to take the next steps here together. Let's install a role and a feature into Windows so that we can start making this server work for us.

Getting ready

As long as you have a Windows Server 2016 installed and running, you are ready to install roles and features onto that machine.

How to do it…

To install a role and a feature into Windows, perform the following steps:

Open Server Manager. In the middle of the screen, you'll see a link that says Add roles and features. Click on that link.Click Next on the first summary screen and you will come to a choice on the second page. For most roles and features, we want to leave it set at the top bullet, which is Role-based or feature-based installation. If we were configuring Remote Desktop Services, which we will discuss in another chapter, then we would choose the second option.Now we choose where we want to install a new role or feature. This is a neat page, as we can choose from any server that we have added into our Server Manager, or we can even choose to install a role or feature into a virtual hard disk. I am running the Add Roles Wizard