virtual machines

Export Virtual Machines in a Cluster

Q: How can I easily export every virtual machine in a cluster to a folder?

A: The best approach for protecting your virtual environment is using a VSS-aware protection such as System Center Data Protection Manager. However,  you might occasionally just want to quickly export every virtual machine out to a folder. This is easy to do with just a few lines of PowerShell code.

$VMs = Get-ClusterGroup | ? { $_.GroupType –eq "VirtualMachine" } | Get-VM
Foreach ($VM in $VMs)
{
    Export-VM -ComputerName $VM.computername -Name $VM.name -Path C:\ClusterStorage\StorageSpace_VMs\Backup
}

The end result is that each virtual machine will be in its own subfolder under the specified path.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish