Book Image

Windows Server Automation with PowerShell Cookbook - Fourth Edition

By : Thomas Lee
Book Image

Windows Server Automation with PowerShell Cookbook - Fourth Edition

By: Thomas Lee

Overview of this book

With a foreword from PowerShell creator Jeffrey Snover, this heavily updated edition is designed to help you learn how to use PowerShell 7.1 effectively and manage the core roles, features, and services of Windows Server in an enterprise setting. All scripts are compatible with both Window Server 2022 and 2019. This latest edition equips you with over 100 recipes you'll need in day-to-day work, covering a wide range of fundamental and more advanced use cases. We look at how to install and configure PowerShell 7.1, along with useful new features and optimizations, and how the PowerShell compatibility solution bridges the gap to older versions of PowerShell. Topics include using PowerShell to manage networking and DHCP in Windows Server, objects in Active Directory, Hyper-V, and Azure. Debugging is crucial, so the book shows you how to use some powerful tools to diagnose and resolve issues with Windows Server.
Table of Contents (18 chapters)
16
Other Books You May Enjoy
17
Index

Using Hyper-V VM groups

Hyper-V VM groups allow you to group VMs for automation. There are two types of VM groups you can create, VMCollectionType and ManagementCollectionType:

  • A VMCollectionType VM group contains VMs
  • A ManagementCollectionType VM group contains VMCollectionType VM groups

With VM groups, you could have two VMCollectionType VM groups, SQLAccVMG (which contains the SQLAcct1, SQLAcct2, and SQLAcct3 VMs) and SQLMfgVMG, which contains the SQLMfg1 and SQLMfg2 VMs. You could then create a ManagementCollectionType VM group, VM-All, containing the two VMCollectionType VM groups.

The VM groups feature feels incomplete. For example, there are no -VMGroup parameters on any of the Hyper-V cmdlets enabling you to configure a VM group, and having two types of groups seems over the top. The feature could be useful for very large VM hosts running hundreds of VMs, if only from an organizational perspective, but all in all, this feature could be improved...