Quick live storage move all VMs to another location

Learn some easy PowerShell to move the storage of every VM on a server.

John Savill

May 21, 2016

1 Min Read
Quick live storage move all VMs to another location

Q. How can I quickly move the storage of every VM on a server to another location?

A. The PowerShell below will move the storage of every VM on a server to a new location. You should change the $newpath variable with the static path that you want for your new VM storage location.

$VMstoMove = Get-VM | Select-Object -expandProperty Nameforeach ($VM in $VMstoMove){    write-host $VM    $vmobj = get-vm -Name $VM    $newpath = "F:VMs + $VM    Move-VMStorage -DestinationStoragePath $newpath -VM $vmobj}

 

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