Connect to vCenter
Connect to the vCenter that owns the inventory and avoid running destructive commands while building an inventory report.
Collect VM inventory
Capture VM name, power state, host, cluster, datastore, guest OS and configured CPU and memory. This gives you a useful baseline without changing configuration.
Audit snapshots
List VMs with snapshots and include snapshot age and size where available. Old snapshots should be reviewed before datastore capacity becomes a problem.
Collect host and datastore data
Record ESXi version, connection state, CPU and memory capacity, datastore capacity and free space. Use this as a capacity and lifecycle baseline.
Export to CSV
Export separate datasets or a combined report so the information can be reviewed in Excel or consumed by another automation process.
Schedule the report
Once validated, run the inventory on a schedule and compare it with the previous baseline to identify configuration drift.
Useful commands
Get-VM | Select Name,PowerState,VMHost,NumCpu,MemoryGB
Get-VMHost | Select Name,Version,ConnectionState
Get-Datastore | Select Name,CapacityGB,FreeSpaceGB
Get-Snapshot -VM * | Select VM,Name,CreatedMore VMware troubleshooting
Explore practical VMware, Windows Server, Hyper-V, Azure, PowerShell and MABS runbooks.
Browse all articles →