Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By : Thomas Lee, Ed Goad
Book Image

Windows Server 2016 Automation with PowerShell Cookbook - Second Edition

By: Thomas Lee, Ed Goad

Overview of this book

This book showcases several ways that Windows administrators can use to automate and streamline their job. You'll start with the PowerShell and Windows Server fundamentals, where you'll become well versed with PowerShell and Windows Server features. In the next module, Core Windows Server 2016, you'll implement Nano Server, manage Windows updates, and implement troubleshooting and server inventories. You'll then move on to the Networking module, where you'll manage Windows network services and network shares. The last module covers Azure and DSC, where you will use Azure on PowerShell and DSC to easily maintain Windows servers.
Table of Contents (21 chapters)
Title Page
Credits
About the Author
Acknowledgment
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Creating a Hyper-V health report


Any Hyper-V host that you deploy is a critical part of your IT infrastructure. If the Hyper-V host goes down or starts suffering performance or capacity issues, it can affect all the VMs running on that host. Your Hyper-V hosts are almost certainly mission critical.

If you deploy Hyper-V, it is important you report on and monitor the health of your Hyper-V host, as well as the health of the VMs. By monitoring the reports, you can detect issues, possibly before they become critical. If your VM host, for example, has a slowly increasing CPU load, you can consider moving a VM to another VM host.

Reports that you use to monitor the health of a Hyper-V host fall into two broad categories: the VM host itself, and the VMs running on that host. This recipe creates two reports to mirror this.

This recipe uses a variety of methods to obtain key performance and usage metrics and converts this information into an object. The recipe begins by defining a PowerShell hash table...