change the Lockdown Mode on all hosts managed by vCenter
Follow the below steps to achieve the requirement:$vCenter = 'vCenterServer_Name_or_IP_address'
Connect-VIServer $vCenter
$Scope = Get-VMHost #This will change the Lockdown Mode on all hosts managed by vCenter, amend this if you need to foreach ($ESXhost in $Scope) {
(get-vmhost $ESXhost | get-view).ExitLockdownMode() # To DISABLE Lockdown Mode
# (get-vmhost $ESXhost | get-view).EnterLockdownMode() # To ENABLE Lockdown Mode
}
Disconnect-VIServer -Server $vCenter -Confirm:$false