Trying to get all VMs use a provider. The issue is making the call from the provider to then get all the vApps - it cannot be made this way
Does anyone have a clean way of perfroming this action? ( A whole cluster (One of the many provider vDCs we have ) is going down, so i would like to generate a list.
Every Org has anywhere from 1-5 organization vDCs, so parsing it that way is a last resort in my book.
Thoughts? Suggestions?
$report = @()
$list = Get-ProviderVdc "Provider vDC" | get-civapp
foreach ($Vapp in $list){ $vms = $vapp | get-civm foreach($vm in $vms){ if($vm) { $vm | %{ $row = "" | select "name", "owner", "Email" $row."name" = $_.name $row."owner" = $vapp.Owner.FullName $row."Email" = $vapp.Owner.Email } } $report += $row } } $report = $report | Sort-Object -Property Owner $report | export-csv "C:\Vcloud-cluster-VMs.csv" -NoTypeInformation -UseCulture