I have a script to list VM affinity rules for all clusters in every datastore:
ForEach ($dc
inGet-Datacenter){$dc|Get-Cluster|Get-DrsRule–typeVMHostAffinity|
sortcluster
|selectName,Cluster,Enabled,
@{N=’DataCenter’;E={$dc}
}}
Is there a way to disable VM affinity rules for clusters by name? For example:
For all clusters in all datacenters in vCenter01
If -cluster.name = Cluster01,cluster02
then do nothing
else
affinityrules = remove
Above is just a rough draft of what im trying to accomplish and working on now. Any ideas?