Book Image

Windows Server 2019 Cookbook - Second Edition

By : Mark Henderson, Jordan Krause
Book Image

Windows Server 2019 Cookbook - Second Edition

By: Mark Henderson, Jordan Krause

Overview of this book

Do you want to get up and running with essential administrative tasks in Windows Server 2019? This second edition of the Windows Server 2019 Cookbook is packed with practical recipes that will help you do just that. The book starts by taking you through the basics that you need to know to get a Windows Server operating system working, before teaching you how to navigate through daily tasks using the upgraded graphical user interface (GUI). You'll then learn how to compose an optimal Group Policy and perform task automation with PowerShell scripting. As you advance, you’ll get to grips with faster app innovation, improved Windows security measures, and hybrid cloud environments. After you’ve explored the functions available to provide remote network access to your users, you’ll cover the new Hyper-V enhancements. Finally, this Windows Server book will guide you through practical recipes relating to Azure integration and important tips for how to manage a Windows Server environment seamlessly. By the end of this book, you’ll be well-versed with Windows Server 2019 essentials and have the skills you need to configure Windows services and implement best practices for securing a Windows Server environment.
Table of Contents (18 chapters)

Using PowerShell to request a new certificate

So far, we've seen that most of the work we've done with the CA service has been done through GUIs with lots of clicking. This is fine for one-off tasks, and we're about to see how to automatically enroll entire batches of computers with certificates. But what about the middle ground – where you want to issue certificates to some computers, perhaps as part of an automated script?

Well, have no fear – PowerShell has all the tools we need to do the exact same work from Windows servers.

Getting ready

We're going to request a certificate from a Windows Server 2019 web server from our CA that we set up earlier for issuing web certificates. In this example, I'm issuing a custom template called WebECDH, but you could issue from any of your existing certificate templates.

How to do it…

In this recipe, we're going to request a certificate with a custom hostname. This is so we can...