VM: vm-8.vmrc-lock

Information

Virtual machines must be configured to lock when the last console connection is closed. Locking virtual machines when the last console connection closes can prevent potential unauthorized access from attackers exploiting logged-in console sessions.

Solution

Get-VM -Name $VM | Get-AdvancedSetting -Name tools.guest.desktop.autolock | Set-AdvancedSetting -Value $true

See Also

https://github.com/vmware/vcf-security-and-compliance-guidelines/raw/refs/heads/main/security-configuration-hardening-guide/vsphere/8.0/