<< Back to Script Library

Connect to Hyper-V VM Console

Connects to the console of the Hyper-V virtual machine using the Hyper-V Virtual Machine Connection Tool (vmconnect.exe)
Version: 1.1.5
Created: 2017-06-13
Modified: 2018-11-26
Creator: Trentent Tye
Downloads: 101
Tags: Hyper-V
The Script Copy Script Copied to clipboard
<#
    .SYNOPSIS
    A simple script that will open the VM console on a Hyper-V host. This script assumes you have all necessary permissions
    to do this action

    .DESCRIPTION
    Takes two parameters from ControlUp (Hostname and VM Name) and gets the necessary properties to open
    a console.  This script was written assuming you had permissions to do this.

    AUTHOR: Trentent Tye
    LASTEDIT: 2017-06-13
    VERSI0N : 1.0
    
#>

#GetVM Properties
$vm = Get-VM -name $args[1] -ComputerName $args[0]

#launch VM connect and connect to console
Start-Process VmConnect.exe -argumentList "$args[1] -G $($vm.Id)"