#Autentification et connection au vCenter

$credentialvCenter = Get-Credential administrator@vsphere.local
$vc = Connect-VIServer -Server vcsa.vmware.lab -Credential $credentialvCenter

$ESXI = (Get-Cluster -Name "PowerCLI-HA" | Get-VMHost)

foreach ($vesxi in $ESXI)
    {
    Get-VMHost -Name $vesxi | Get-VMHostNetworkAdapter | where { $_.PortGroupName -eq "Management Network" }`
     | Set-VMHostNetworkAdapter -VMotionEnabled $true -Confirm:$false
      
    }

