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

John Savill

June 2, 2011

1 Min Read
ITPro Today logo in a gray background | ITPro Today

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.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like