I'm in need a of powercli script that helps to determine whether affinity rules are configured on any cluster or host.
TIA
See Spotlight on the New DRS Groups and VM-Host Rule Cmdlets!
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I've this script which worked on 6.0, but, it is not working on 6.5 version (not giving any output when I ran this) -
$report = foreach($vc in $global:DefaultVIServers){
foreach ($cluster in Get-Cluster -Server $vc){
Get-DrsRule -Cluster $cluster|
Select Name, Type, Enabled,
@{N='vCenter';E={$vc.Name}},
@{N='Cluster';E={$cluster.Name}}
}
}
$report |Export-Csv -Path ".\DRSRuleReport-$(Get-Date -Format 'MMdd-HHmm').csv" -NoTypeInformation -UseCulture
Works perfectly for me.
Perhaps there are no rules?
Are you looking at the correct CSV file?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference