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

Backup and restore a Hyper-V Virtual Machine


There are many ways to back up a Hyper-V VM. You could, of course, use the recipes in this chapter inside the VM to back up your VM's hard drive contents to a network drive. As an alternative, you could use WSB to backup an entire VM and restore it.

Regarding the WSB commands to use when backing up a Hyper-V VM, you have options. You can use the WSB cmdlets, as you have done so far in this chapter. Or, you can use the Wbadmin console application. Wbadmin is a Windows command line tool that pre-dates the PowerShell module. It has the advantage of being higher ranked in search engines—useful if you wish to learn more. You may also find Wbadmin simpler to use in practice. This recipe shows how to use Wbadmin to create a backup of your VM and then restore it.

Getting ready

For this recipe, you need a Windows Server 2016 system with Hyper-V installed plus a working VM. In this recipe, you use the Windows Server 2016 host, HV1, that runs the DC1.Reskit...