SHARE
TWEET

Create HyperV SnapShots

a guest Nov 15th, 2012 40 Never
  1. $array = "HostName1","HostName2"  #etc. As many as you'd like.
  2.        
  3. Foreach ($h in $array) {
  4. $VMManagementService = Get-WmiObject -ComputerName $h -Namespace root\virtualization -Class Msvm_VirtualSystemManagementService
  5. $SourceVm = Get-WmiObject -computername $h -Namespace root\virtualization -QuerySelect * From Msvm_ComputerSystem"
  6. Foreach ($i in $SourceVm)
  7.    {$VMManagementService.CreateVirtualSystemSnapshot($i)
  8.    }
  9. }
RAW Paste Data
Top