0

i am using below script to get snapshot which are associated with my particular VM, but i am getting only recent snapshot information , can someone correct me in below script -

$vmcheck = Get-VM -name VMNAME | where {$_.LastRestoredVMCheckpoint -like “* *”}

[string]$body = “`n”

$body += “NameCheckPointLocation`n”

foreach($vm in $vmcheck) {

$body += (“{0}{1}{2}`n” -f ($vm.name,$vm.LastRestoredVMCheckPoint,$vm.CheckPointLocation))

}

$body += “`n”

i need all the snapshots list which are associated with my vm

kamlesh bhatt
  • 51
  • 1
  • 2
  • 5

1 Answers1

0

This is what you want (*):

$vm = Get-SCVirtualMachine -Name VMNAME
$vmCheckpoints = $vm.VMCheckpoints
foreach($checkpoint in $vmCheckpoints) {
  Write-Host $checkpoint
}

(*) I'm going on memory. I don't have immediate access to SCVMM at the moment.

DocGreene
  • 1
  • 2