Windows Server 2019 Cookbook
上QQ阅读APP看书,第一时间看更新

Preface

Windows is, and will probably always be, the leader in server software for businesses. In any data center in the world that supports desktop Windows computers, you will find Windows Server. You will also find Windows powering one of the world's largest cloud environments – Microsoft Azure. Businesses have been relying on Windows and Windows Server for almost 25 years, and not without reason! Windows Server 2019 continues the long-standing tradition of providing all the core functionality from previous versions of Windows Server along with many enhancements and improvements new to this version of Windows.

Windows has seen a substantial shift in the past 10 years towards remote management. Where once upon a time you had to log into inpidual servers, now almost everything can be done from the comfort of your Windows 10 desktop. Many remote management GUIs are available, and for those who like scripting and repeatability there's a large focus on PowerShell. Windows Server 2019 is no exception, and for the first time in the Windows Server cookbook series we'll be looking at this extensively.

When I was approached to continue the excellent work of Jordan Krause, who wrote the previous editions of the book, I was excited at the idea of being able to educate readers on many of the common mistakes I see made in Windows environments around the globe. I've seen more badly named Active Directory domains than well-named ones. I've seen so many web servers that were meant to be identical but where one or two have been configured differently. I see companies that don't have the right tools in place to be able to reconstruct a security incident after the fact. I saw this edition of this book as my chance to share the knowledge I've built up over the past 15 years. Windows Server 2019 has so many wonderful features that are woefully under-utilized. Desired State Configuration is one particular example that, if used properly, could have saved a lot of the heartache I've seen.

You may be asking yourself why this book even exists – isn't everything moving to the cloud? Why do I need to learn all this? The simple answer is that most of the things you learn here are still relevant to the cloud! The cloud isn't some magic wand that you can wave over your infrastructure and make it all just work. There's still management that needs to be done. Servers still need configuring, users need administering, file servers still need anti-virus. There are also a lot of workloads that are not moving to the cloud yet. Any medium to large business probably has at least one or two Windows servers sitting in a rack in each office. And let's not forget that cloud services only work well if you have a solid, high - bandwidth, low - latency internet connection. For countries where internet bandwidth is limited or expensive, then on-premises hardware will surely always win. So, whether or not your company is going all-in on the cloud, you will still need a good, fundamental, solid understanding of Windows Server 2019.

A book about Windows Server can't just focus on the new fancy pieces. It also needs to lay a good foundation to get you to a point where you can use these new features with confidence. That's why a lot of the recipes early on in this book cover doing things two ways: once via the GUI and a second time via PowerShell. As we get into the more advanced chapters of the book, the GUI will be seen less and less, and we'll be in PowerShell a lot more. As your skills in PowerShell improve, my hope is that you can take the foundations found in this book and maybe one day you can write your own book about your adventures in Windows administration. Maybe you will take over the reins of the Windows Server cookbook series!

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. The ideal target is desktop administrators wanting to get into the server world, and developers hoping to better understand the infrastructure upon which their applications run. The target readers may also have some experience in previous versions of Windows Server but be interested in some of the new 2019 features or wants to know how to manage servers remotely. All 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 2019 environment should find something interesting in this book.

What this book covers

Chapter 1, Learning the interface, takes you on a journey of working with Windows Server 2019 as we figure out how to navigate through the new look and feel of this new operating system, and gain some tips and tricks to complete our daily chores efficiently.

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, Networking, runs through many common network configurations and useful tools that you'll need to know to configure a Windows network.

Chapter 4, Working with Certificates, starts to get us comfortable with the creation and distribution of certificates within our network. Public Key Infrastructure is an area that administrators increasingly need to use and operate, but many administrators have not yet had an opportunity to work hands-on with it.

Chapter 5, Internet Information Services, brings us into the configuration of a Windows Server 2019 server as a web server in our network. We will start to tie in the earlier chapters of this book – we'll be using network configuration, core infrastructure tasks, and certificates in this chapter. We'll also be looking at a certificate authority called Let's Encrypt.

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

Chapter 7, Remote Desktop Services, encourages you to look into using Server 2019 as a virtual session host or VDI solution. Remote Desktop Services (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 Windows Server 2019 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, and checking for viruses.

Chapter 9, System Insights, covers a new feature in Windows Server 2019 that allows large-scale analysis and predictions of server health and capacity. We look at how we can use this for capacity planning, and how you might integrate it into an existing monitoring system. We also do a lot of work in the new Windows Admin Center.

Chapter 10, 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 2019.

Chapter 11, 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 such as DFSR, iSCSI, and Windows Server 2019 Work Folders. We also look at building a scale-out file server.

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

Chapter 13, 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. We also look at another brand-new Windows Server 2019 feature: nested resilience.

Chapter 14, Containers and Docker, takes us into one of the most exciting technologies since virtualization became mainstream. It's an entirely new way of deploying server applications. Most of the talk regarding containers has been about Linux, but did you know that Windows supports containers too? Docker is the most popular container platform, and Windows Server 2019 supports it! You'll learn the basics of how Docker works with Windows and we'll build a Minecraft server while we're at it.

Chapter 15, Desired State Configuration and Automation, teaches a new tool for ensuring that your servers are consistently configured. This allows you to easily deploy dozens, hundreds, or thousands of identically configured servers (for example, a web server tier), update their configuration by updating a single file, and undo any changes that might have been made by other services. DSC integration is also provided by other tools, such as Puppet; however, Microsoft's preferred DSC management method is with Azure.

Chapter 16, Hardening Your Infrastructure, takes a look at the most secure version of Windows Server yet. Windows Server 2019 is more secure out of the box than any Windows version previously. However, you cannot just stop at the defaults. Every environment is different. In this chapter, you will learn about the tools and processes you need to ensure that you can secure your Windows servers in the ways that are the most appropriate for you.

To get the most out of this book

All the technologies and features that are discussed in the recipes of this book are included with Windows Server 2019! As long as you have access to the operating system installer disk 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 for 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 2019. With this available, you will be able to build recipe upon recipe as we move through setting up the core infrastructure tasks, and then build upon those same servers in the later recipes.

Building a baseline lab network running Server 2019 for the Microsoft infrastructure roles such as 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.

If you are using the digital version of this book, we advise you to type the code yourself or access the code via the GitHub repository (link available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  1. WinRAR/7-Zip for Windows
  2. Zipeg/iZip/UnRarX for Mac
  3. 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Windows-Server-2019-Cookbook-Second-Edition. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Code in Action

Code in Action videos for this book can be viewed at (https://bit.ly/3eu4Boy).

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: http://www.packtpub.com/sites/default/files/downloads/9781838987190_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, command, folder names, filenames, file extensions, server names, dummy URLs and user input. Here is an example: "Restart-Computer is a PowerShell command that does the same thing as shutdown /r /t 0 – but is much easier to remember."

A block of code is set as follows:

Write-Host "Hello! Here is the current date and time: $(Get-Date)"

Write-Host "The name of your computer is: $(hostname)"

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

hostname

shutdown /r /t 0

Bold: Indicates words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Now, when you click on Shut down or Restart, you are asked to supply a reason why you are restarting."

Tips or important notes

Appear like this.

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, 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 you more knowledgeable about the recipe.

See also

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

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at customercare@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Reviews

Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!

For more information about Packt, please visit packt.com.