A few moments ago I saw a blog post from Ben Armstrong (Microsoft) about using PowerShell to list all snapshots from a virtual machine.
That script will ask you which VM to look at, and will output a list of snapshots that belong to this VM.
That got me thinking… Most of the times, I don’t want to know this information about “just” one VM… I want to know it from all VM’s! Preferably including the tree of snapshots…
And here comes PowerShell again, with a simple one-liner:
Get-VM | Get-VMsnapshotTree | Select VM,Name,Description,Created
I found this to be especially useful in large environments where departments are allowed to manage their own virtual machines, for example developers. When snapshots are created but never removed when they are no longer needed, this will give you a simple output which allows you to contact the appropriate persons