Report on all VMs with snapshots

Report on all VMs with snapshots

Snapshots are one of those things that tend to get created and then forgotten over time until you run out of disk space and can't quite figure out why. The script below will give you a handy way to generate a tabular report showing all of your VMs that have snapshots and when they were created. Its a quick "two liner", with the first line just getting you connected to your VC, and the 2nd line doing the heavy lifting of enumerating all of the VMs, finding the shapshots, looking up what host currently houses the VM and then creating the actual table

  1. connect-viserver VCServerName

  2. get-vm | get-snapshot | Select-Object VM, Name, Description, PowerState, Created, @{Name="Host"; Expression = {(Get-VM $_.VM).Host.Name}} | ft -auto

The output looks like

VM

Name

Description

PowerState

Created

Host

S5

Pre 4.1 Upgrades

PoweredOn

11/21/2008 7:13:27 AM

abc.domain.com

W2K3-Router

Test Snapshot

Test description

PoweredOn

1/8/2009 1:12:10 AM

abc.domain.com

BT

Pre WSS

PoweredOff

8/10/2008 11:38:37 PM

def.domain.com

Comments

Awesome... I was looking for this for sometime... thanks for providing the info!

Daniel

Version history
Revision #:
1 of 1
Last update:
‎01-10-2009 08:45 PM
Updated by: