Reputation: 5
I am creating and new audit script for our VMware hosts. One of the paramiters is to check the "Lockdown Mode" status. I came up with the following line but it seems more of a hack. Is their a more elegant way to query the Lockdown Mode on a host?
#hostname
$vmh = host
$status = (Get-view (Get-VMHost $vmh | Get-view).ConfigManager.HostAccessManager).LockdownMode
write-host $status
Upvotes: 0
Views: 1770
Reputation: 2121
Give this a go:
(Get-VMHost -Name $vmh).ExtensionData.Config.LockdownMode
Upvotes: 1