I recently asked myself what was the easiest way to get all VMware snapshots and came across a quick and easy way using Powershell and the PowerCLI module.
Get All VMware Snapshots using PowerCLI
You’re going to have to download and install the PowerCLI module as a prerequisite so I’ve linked an article we’ve previously wrote on how to do just that.
Now for the command.
Get-VM | Get-Snapshot | select VM, Name, Created
This method definitely beats having to right click each virtual machine and navigating one by one to see if the snapshot manager has something in memory.
Bonus Tip
If you find that you want to remove all snapshots at once you can append the Remove-Snapshot to the end of the Get-Snapshot. It would look something like this.
Note: We also want to append the Confirm parameter so it doesn’t prompt us to delete after running the command.
Get-VM | Get-Snapshot | Remove-Snapshot -Confirm:$false
Don’t forget to follow us on Youtube for more Sysadmin content
#PowershellBooks :
Learn PS month of Lunches