Quantcast
Channel: VMware Communities : Popular Discussions - vCloud Director PowerCLI
Viewing all articles
Browse latest Browse all 13334

Vcloud powerCLi - VM inventory report

$
0
0

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?


Viewing all articles
Browse latest Browse all 13334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>