Hi folks,
I need to get all the AA rules for a bunch of VMs.
This here is the format I was looking for, can anyone modify this so it fills in the "VMNames" column? As it is now it outputs everything except that column has System.Object[] in it , instead of the VMs that comprise the rule
Get-DrsRule -Cluster $cluster | select Cluster,Name,KeepTogether,Enabled, @{N="VMnames";E={ $_.Vmids|%{(get-view -id $_).name}}} | Export-Excel c:\temp\AArules-myservers.xlsx -AutoFilter -AutoSize
Thanks!
You could do something like this
Get-DrsRule -Cluster $cluster |
Select-Object Cluster, Name, KeepTogether, Enabled,
@{N = "VMnames"; E = { ($_.Vmids | ForEach-Object { (Get-View -Id $_).name}) -join '|'}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You could do something like this
Get-DrsRule -Cluster $cluster |
Select-Object Cluster, Name, KeepTogether, Enabled,
@{N = "VMnames"; E = { ($_.Vmids | ForEach-Object { (Get-View -Id $_).name}) -join '|'}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
That is exactly what I was looking for, thanks LucD.