Lead Image © liu liming, 123RF.com

Lead Image © liu liming, 123RF.com

Administering virtual machines with PowerShell Direct

Direct Access

Article from ADMIN 34/2016
By
Managing virtual machines with PowerShell used to require some complex configuration steps, but with version 5, PowerShell can now access a Hyper-V VM directly, which means you don't need to configure a virtual network connection.

The Hyper-V virtualization system is one of the most important services in Microsoft's server family, and the PowerShell administration interface is a logical choice for managing Hyper-V virtual machines (VMs). After loading the command extension, by using Import-Module Hyper-V, you have more than 200 new commands at your disposal (depending on the version) for managing your hypervisor and VMs. You can manage the whole deployment and hardware configuration with PowerShell commands. For instance, you can create a new machine with the command:

> new-vm -Name win8 -MemoryStartupBytes 512MB -BootDevice CD

However, if you want to implement PowerShell instructions on the VM you just created, the process can be cumbersome. PowerShell relies on web service management for remote requests. This service protocol, attached to HTTP(S), accepts requests on defined ports via a listener. The guest and host are thus confined to communicating through some form of virtual networking.

Another option for VM management is the WinRM remote management service, which is also a tool that depends upon a network.

Until recently, managing a VM through PowerShell was never an easy option. However, with the arrival of PowerShell version 5, and since Windows 10 or the preview of Server 2016, Microsoft has provided a means for direct management of virtual systems without networking. A new featured called PowerShell Direct lets you run arbitrary commands on a Windows 10 or Windows Server 2016 VM regardless of network or remote access settings.

PowerShell Direct offers a powerful alternative to conventional management tools like VMconnect that makes use of PowerShell's flexibility and superior automation features. Using Windows 10 and Server 2016 on both sides of the communication channel (on the hypervisor and the VM) is a precondition for using PowerShell Direct. In addition, local installation of the guest systems is necessary.

...
Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy ADMIN Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

comments powered by Disqus
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs



Support Our Work

ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.

Learn More”>
	</a>

<hr>		    
			</div>
		    		</div>

		<div class=