This isn’t really documented anywhere on the VMware website, but it comes in really handy if require certain users to have console access to machines without the complication of the vSphere Web Client.

  • Install VMware Player from the VMware website

  • Get the Managed Object ID of the VM. This can be done through PowerCLI with the following script:

1
2
3
4
5
6
7
8
9
$vcenter = "vcenter.domain.name"
$targetvm = "targetvm"
Add-PSSnapin VMware.VimAutomation.Core
Connect-VIServer -Server $vcenter -Force
$vmid = (Get-VM $targetvm).id -replace "VirtualMachine-",""
Disconnect-VIServer -Server $vcenter -Confirm:$false
Write-Output "VM MOID is $vmid"
  • Give the user access to the VM. The permission “Virtual Machine\Interaction\Console Interation” needs to be given on both the VM and the host. It doesn’t need to inherit to children so deselect “Propagate to children” in the permisisons screen”.

  • Create a shortcut to connect straight to the VM. The following PowerShell script can create the shortcut automatically.

1
2
3
4
5
6
7
8
9
$desktop = [Environment]::GetFolderPath("Desktop")
$vcenter = "vcenter.domain.name"
$targetvm = "targetvm"
$vmid = "vm-moid"
$WshShell = New-Object -comObject WScript.Shell
$Shortcut = $WshShell.CreateShortcut("$desktop\$targetvm.lnk")
$Shortcut.TargetPath = "vmrc://$vcenter/?moid=$vmid"
$Shortcut.Save()

Afterwards, double click on the shortcut on the desktop and enter appropriate credentials. You’ll be straight in to the console.

Comment and share

The following script generates a report of all datastores and their multipathing policy. This was extremely useful when fixing up some datastores to use best practices with our 3PAR systems.

Run with:

.\multipathing.ps1 -vCenter vcenter.domain.com -VMHost esxi.domain.com

Comment and share

  • page 1 of 1

Jacob Ludriks

author.bio


author.job