diff --git a/esxi-scripts/disable-system-vms.ps1 b/esxi-scripts/disable-system-vms.ps1 index 6595bc5b..18d9b817 100755 --- a/esxi-scripts/disable-system-vms.ps1 +++ b/esxi-scripts/disable-system-vms.ps1 @@ -4,6 +4,7 @@ Connect-VIServer -Server $VCENTERHOST -Protocol https -User $VCENTERUSER -Password $VCENTERPASS | Out-Null -Set-DrsRule -Rule "System VMs (S)" -Enabled $false; +$vm = Get-VM "System VMs (S)" +Set-DrsRule -Rule $affinityRule -VM $vm -Enabled $false; Disconnect-VIServer -Server $VCENTERHOST -Force –Confirm:$false \ No newline at end of file