• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Yellow Bricks

by Duncan Epping

  • Home
  • Unexplored Territory Podcast
  • HA Deepdive
  • ESXTOP
  • Stickers/Shirts
  • Privacy Policy
  • About
  • Show Search
Hide Search

VM Report

Duncan Epping · Jun 27, 2008 ·

I had some spare time on my hands so I decided to add some useful stuff to the VM Reporting powershell script that was posted on this blog. This is what I ended up with, there’s still room for improvement like snapshot information and scsi controller info…


Get-VIServer -Server 192.168.1.1 -User admin -Password admin

$Report = @()

get-vm | % {
$vm = Get-View $_.ID
$ReportRow = "" | Select-Object VMName, Hostname, OS, IPAddress, VMState, TotalCPU, TotalMemory, MemoryUsage, TotalNics, ToolsStatus, ToolsVersion, MemoryLimit, MemoryReservation
$ReportRow.VMName = $vm.Name
$ReportRow.HostName = $vm.guest.hostname
$ReportRow.OS = $vm.guest.guestFullName
$ReportRow.IPAddress = $vm.guest.ipAddress
$ReportRow.VMState = $vm.summary.runtime.powerState
$ReportRow.TotalCPU = $vm.summary.config.numcpu
$ReportRow.TotalMemory = $vm.summary.config.memorysizemb
$ReportRow.MemoryUsage = $vm.summary.quickStats.guestMemoryUsage
$ReportRow.TotalNics = $vm.summary.config.numEthernetCards
$ReportRow.ToolsStatus = $vm.guest.toolsstatus
$ReportRow.ToolsVersion = $vm.config.tools.toolsversion
$ReportRow.MemoryLimit = $vm.resourceconfig.memoryallocation.limit
$ReportRow.MemoryReservation = $vm.resourceconfig.memoryallocation.reservation
$Report += $ReportRow
}
$Report | Export-CSV c:\export.csv

Related

Server 3.5, ESX, Scripting, VMware

Primary Sidebar

About the Author

Duncan Epping is a Chief Technologist and Distinguished Engineering Architect at Broadcom. Besides writing on Yellow-Bricks, Duncan is the co-author of the vSAN Deep Dive and the vSphere Clustering Deep Dive book series. Duncan is also the host of the Unexplored Territory Podcast.

Follow Us

  • X
  • Spotify
  • RSS Feed
  • LinkedIn

Recommended Book(s)

Advertisements




Copyright Yellow-Bricks.com © 2025 · Log in