earth4s
earth4s

Reputation: 5

Query VMHost lockdown status

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

Answers (1)

Kyle Ruddy
Kyle Ruddy

Reputation: 2121

Give this a go:

(Get-VMHost -Name $vmh).ExtensionData.Config.LockdownMode

Upvotes: 1

Related Questions