Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft Hyper-V PowerShell Automation

You're reading from   Microsoft Hyper-V PowerShell Automation Manage, automate, and streamline your Hyper-V environment effectively with advanced PowerShell cmdlets

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784391539
Length 124 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Vinith Menon Vinith Menon
Author Profile Icon Vinith Menon
Vinith Menon
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. New PowerShell Cmdlets in Hyper-V on Windows Server 2012 R2 FREE CHAPTER 2. Managing Your Hyper-V Virtual Infrastructure 3. Managing Your Hyper-V Virtual Machines 4. Creating Reusable PowerShell Scripts Using Hyper-V PowerShell Module Cmdlets 5. The Next Step – Integration with SCVMM 6. Troubleshooting Hyper-V Environment Issues and Best Practices Using PowerShell Index

Configuring properties on virtual machines

Configuring properties on virtual machines can be done using PowerShell cmdlets that have the Set verb in them. To get a list of all the PowerShell cmdlets that can be used to set a virtual machine's properties, type command shown in the following screenshot, in the PowerShell prompt:

Configuring properties on virtual machines

As you can see in the preceding screenshot, there are a number of properties that can be set for the virtual machine, including the BIOS, DVD drive, virtual machine memory, and also network adapter properties. Also, there is a Set-VMHost cmdlet that allows you to set some of the properties related to the Hyper-V host. Let's go through these cmdlets one by one.

Type the following cmdlet in the PowerShell prompt to change the automatic stop action of all the VMs running on both nodes of the Hyper-V cluster:

Get-ClusterNode | select @{l='ComputerName';e={$_.name}} | % {Get-VM -ComputerName $_.computername | Set-VM -AutomaticStopAction shutdown }

Note...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image