PowerCLI

Get esxi services status

Get-VMHostService -VMHost $vmhost

Lockdown Mode

(Get-VMHost $vmhost).Extensiondata.Config.admindisabled

(Get-VMHost $vmhost | Get-View).EnterLockdownMode()

(Get-VMHost $vmhost | Get-View).ExitLockdownMode()

(Get-VMHost $vmhost).Extensiondata.Config.admindisabled

Same thing from esxi console

# vim-cmd -U dcui vimsvc/auth/lockdown_is_enabled

# vim-cmd -U dcui vimsvc/auth/lockdown_mode_enter

# vim-cmd -U dcui vimsvc/auth/lockdown_mode_exit

Get-VMHostService -VMHost esxi01 

Get-VMHostService -VMHost esxi01 | Group-Object -Property Running