Unlike at work, when I access servers in the lab I use the vSphere Client remote console. Unfortunately since vSphere 4.1, copy & paste between the host and the console has been disabled – which I find a pain (even though it’s probably more secure). It can be enabled per-VM with the following two settings:
isolation.tools.copy.disable="false" isolation.tools.paste.disable="false"
I wanted to enable it on all my backend VMs, but not my other VMs (DMZ etc). For this I used the following PowerCLI script:
$esxi = "lab01.mdb-lab.com"
$credential = Get-Credential
$tgtVLAN = 'VLAN70','VLAN80','VLAN120'
Connect-VIServer $esxi -Credential $credential
Get-VM |where {
(Get-NetworkAdapter -VM $_ | %{$tgtVLAN -contains $_.NetworkName}) -contains $true} | %{
New-AdvancedSetting $_ -Name isolation.tools.copy.disable -Value false -Confirm:$false -Force:$true
New-AdvancedSetting $_ -Name isolation.tools.paste.disable -Value false -Confirm:$false -Force:$true
}
}
Disconnect-VIServer $esxi -Confirm:$false
I’d like to thank Luc Dekens for helping me with that last bit. If you get chance, check him out at http://www.lucd.info/.