I really miss onxy.... Such a wonderful tool. I am looking for a script to change the Virtual Machine Console Options for Remote Users as documented here:
Anyone have a clue how to set these variables?
Thanks,
J
The relevant VM configuration parameters are RemoteDisplay.maxConnections and tools.guest.desktop.autolock.
You can edit these settings with the (Get|New|Set|Remove)-AdvancedSetting cmdlets. E.g. run:
Get-VM MyVM1 | New-AdvancedSetting -Name "RemoteDisplay.maxConnections" -Value 3 -Confirm:$false -Force
Get-VM MyVM1 | New-AdvancedSetting -Name "tools.guest.desktop.autolock" -Value "true" -Confirm:$false -Force
Try this:
(get-vm vmName).ExtensionData.Config.MaxMksConnections
(get-vm vmName).ExtensionData.Config.GuestAutoLockEnabled
The relevant VM configuration parameters are RemoteDisplay.maxConnections and tools.guest.desktop.autolock.
You can edit these settings with the (Get|New|Set|Remove)-AdvancedSetting cmdlets. E.g. run:
Get-VM MyVM1 | New-AdvancedSetting -Name "RemoteDisplay.maxConnections" -Value 3 -Confirm:$false -Force
Get-VM MyVM1 | New-AdvancedSetting -Name "tools.guest.desktop.autolock" -Value "true" -Confirm:$false -Force
If you want to use the vSphere API, like Onyx does, you can use for example:
$spec = New-Object VMware.Vim.VirtualMachineConfigSPec
$spec.MaxMksConnections = 2
$spec.GuestAutoLockEnabled = $true
$vm = Get-VM -name VM1
$vm.ExtensionData.ReconfigVM_Task($spec)
If you do not want to limit the number of simultaneous connections to a VM, you have to set the MaxMksConnections to -1.
Works perfectly thanks for the help and speed of help.