Book Image

Microsoft Hyper-V PowerShell Automation

By : Vinith Menon
Book Image

Microsoft Hyper-V PowerShell Automation

By: Vinith Menon

Overview of this book

Table of Contents (13 chapters)
Microsoft Hyper-V PowerShell Automation
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Preface

Microsoft Hyper-V PowerShell Automation comes with a set of real-world scenarios and detailed scripts that will help you get started with PowerShell for Hyper-V and learn what administrative tasks you can do with PowerShell.

This book starts with the essential topics relating to PowerShell and then introduces the new features in Hyper-V version 3.0. This book explores the cmdlets in Hyper-V version 3.0 that can be used to manage and automate all configuration activities for managing the Hyper-V environment. The cmdlets are executed across the network using Windows Remote Management.

This book goes in depth and looks at the new features that are made available with Hyper-V version 3.0, and breaks down the mystery and confusion that surrounds which feature to use when. It also teaches you the PowerShell way to automate the usage of these features.

What this book covers

Chapter 1, New PowerShell Cmdlets in Hyper-V on Windows Server 2012 R2, explores the new features in Hyper-V Windows Server 2012 R2 and the associated cmdlets to manage these features.

Chapter 2, Managing Your Hyper-V Virtual Infrastructure, explores in depth the cmdlets that are available in the Hyper-V PowerShell module. This also covers cmdlets to manage properties of Hyper-V hosts, associated virtual machines, and virtual hard disks.

Chapter 3, Managing Your Hyper-V Virtual Machines, covers cmdlets to manage virtual switches, virtual machine migrations, snapshots, and also Hyper-V Replica.

Chapter 4, Creating Reusable PowerShell Scripts Using Hyper-V PowerShell Module Cmdlets, takes a deep dive into how to approach various complex administrative tasks and explores solutions for them by developing PowerShell scripts based on the Hyper-V PowerShell module.

Chapter 5, The Next Step – Integration with SCVMM, explores the advantages of integrating Hyper-V with SCVMM and the additional Hyper-V cmdlets that come with SCVMM.

Chapter 6, Troubleshooting Hyper-V Environment Issues and Best Practices Using PowerShell, explores the PowerShell way to troubleshoot a Hyper-V deployment. It also looks at the BPA Hyper-V module that helps to make sure that Hyper-V is deployed as per the best practices recommended by Microsoft.

What you need for this book

This book requires that you have Windows PowerShell 3.0, which is available out of the box in Windows Server 2012 and Windows Server 2012 R2. The latter has the Hyper-V role enabled on it. Windows PowerShell 3.0 is also available for earlier versions of Windows as part of Microsoft's Windows Management Framework 3.0. You should also have System Center Virtual Machine Manager 2012 and Windows Server 2012 R2 with you.

Who this book is for

This book is great for administrators who are new to automating Hyper-V administrative tasks using PowerShell. If you are familiar with the PowerShell command line and have some experience with the Windows Server, this book is perfect for you.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "Let's look at the ways you can automate and manage your shared .vhdx guest clustering configuration using PowerShell."

A block of code is set as follows:

$Guid = [System.Guid]::NewGuid()
Set-SCCloud -JobGroup $Guid
$HostGroup = Get-SCVMHostGroup -Name "HostGroup02"
New-SCCloud -JobGroup $Guid -Name "Cloud02" -VMHostGroup $HostGroup -Description "This is a cloud for HostGroup02"

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

Copy-VMFile "Fileserver_VM1" -SourcePath "D:\Test.txt" -DestinationPath "C:\Temp\Test.txt" -CreateFullPath -FileSource Host

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Next, click on Shrink."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.