Q. How can I bulk export every virtual machine on a Hyper-V host?

A. Using the CodePlex Hyper-V module referenced in FAQ "Q. Is there a PowerShell set of cmdlets for Hyper-V outside of using VMM?" You can use the Export-VM cmdlet in combination with the Get-VM cmdlet to export every VM, as shown in the command below.

get-vm | Export-VM -path d:\export -Wait -CopyState

Note that each VM will be exported to its own child folder under the path passed (d:\export in this example) and the -Wait switch says to wait for the export of a VM to complete before moving to the next VM. The -CopyState tells Export-VM to copy all of the VHDs, not just the configuration.

Hide 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.