Here's my script....
$myCol = @()
foreach ($cluster in Get-Cluster)
{
foreach($vmhost in ($cluster | Get-VMHost))
{
foreach($vm in (Get-VM -Location $vmhost)){
$VMView = $vm | Get-View
$VMSummary = "" | Select ClusterName,VMName,MemorySize,VMSockets,VMCores
$VMSummary.ClusterName = $cluster.Name
$VMSummary.VMName = $vm.Name
$VMSummary.MemorySize = $VMView.Hardware.Config.MemorySize / 1024
$VMSummary.VMSockets = $VMView.Config.Hardware.NumCpu
$VMSummary.VMCores = $VMView.Config.Hardware.NumCoresPerSocket
$myCol += $VMSummary
}
}
}
$myCol | Export-Csv C:\Temp\Test.txt
The column "MemorySize" is returning 0 for all VM's...
"DMZ","Trend Micro Deep Security (1)","0","2","1"
"DMZ","Guest Introspection (1)","0","2","1"
Any ideas?