Powershell: Get all Hyper-V Checkpoints in a cluster (and remove them)

Posted on 09/11/2018 · Posted in Microsoft

Powershell is the way to go if you need to get all your checkpoints in a cluster.

Get-VM -ComputerName (Get-ClusterNode -Cluster h-pool) | Get-VMSnapshot | Select VMName,Name,SnapshotType,CreationTime,ComputerName

Get all VM’s that have a checkpoit

You can filter the results by adding a where clause, for example to get all recovery snapshots left behind by Veeam or any other backup solution.

Get-VM -ComputerName (Get-ClusterNode -Cluster h-pool) | Get-VMSnapshot | Where-Object {$_.SnapshotType -eq “Recovery” } | Select VMName,Name,SnapshotType,CreationTime,ComputerName

Get all checkpoints of type Recovery

And to remove those snapshots, just add Remove-VMSnapshot at the end.

Get-VM -ComputerName (Get-ClusterNode -Cluster h-pool) | Get-VMSnapshot | Where-Object {$_.SnapshotType -eq “Recovery” } | Remove-VMSnapshot

As a side note, why is it remove Get-VMsnapshot which sounds like VMware’s Get-Snapshot while they are checkpoints? I just don’t get Microsoft sometimes….