HI all,
So i wrote this quick script to generate a report of VMs info and more specifically, who owns them.
The issue is that I am getting some rows with nothing but the Owner, and all the other colemns are empty.
Connect-Ciserver -Server VCDserver -User Username -Password Password
$report = @()
$Vapp = "*"
foreach($Vapp in Get-CiVapp -Name $vapp){
$vm = $vapp | get-civm
$row = "" | Select "Name", "VApp", "Org", "Status", "Operating System", "CpuCount", "Memory (GB)", Owner
$row."Name" = $vm.Name
$row."Vapp" = $vm.vapp
$row."Org" = $vm.Org
$row."Status" = $vm.Status
$row."Operating System" = $vm.GuestOSFullName
$row."CpuCount" = $vm.CpuCount
$row."Memory (GB)" = ($VM | Measure-Object -Property MemoryMB -Sum).Sum/1024
$row.Owner = $vapp.Owner
$report += $row
}
$report | export-csv "C:\VcloudVMsNEW.csv" -NoTypeInformation -UseCulture
Any ideas?