Code snippet – Report VMs with an open snapshot

This script will report all VMs with an open snapshot.

Just fill in the name of your vCenter Server in the first line:


Connect-VIServer vCenter-Server
foreach($vm in Get-VM){
     foreach($ss in ($vm | Get-Snapshot)){
          $ss | Select @{N="VM-Name";E={$vm.Name}},
               @{N="Snapshot";E={$ss.Name}}
     }
}

Leave a Comment

Your email address will not be published. Required fields are marked *