This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Saturday, September 16, 2017

How to change the Lockdown Mode on all hosts managed by vCenter

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

No comments:

Post a Comment