Virtual Machine Management using PowerShell Direct

Since Windows PowerShell version 5, Microsoft has implemented a new way to directly manage your virtual machines without network connectivity. PowerShell Direct has been introduced in Windows Server 2016 and Windows 10 version. it allows you to create a remoting session without any network connectivity from:

  • Windows 10 Hyper-V host
  • or Windows Server 2016 Hyper-V host

to

  • Windows 10 virtual machine
  • or Windows Server 2016 virtual machine

Basically, this is the same syntax as a PowerShell session, with the only difference that the -VMName parameter is used instead of –ComputerName parameter. Below is an example:

This method allows you to log on to the VM and thus run several commands without network connectivity. Of course, you need to be logged on to the Hyper-V host that hosts the virtual machine that you want to manage!

Now, I disable the network adapter and try to log on the VM without PowerShell Direct, I get an error message:

More information about the Hyper-V architecture here: Hyper-V Architecture

 

Thanks for reading! You can follow me on Twitter @PrigentNico

About Nicolas 216 Articles
I work as a System Engineer, based in Switzerland with a primary focus on Microsoft technologies. I have 7 years experience in administering Windows Servers. . I am a Microsoft MVP for Cloud & Datacenter Management. I also received the PowerShell Hero 2016 award by PowerShell.0rg. And finally, I am "MCSA: Windows Server 2012" and "Administering & Deploying SCCM" certified.