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.
Learn some easy PowerShell to move the storage of every VM on a server.
May 21, 2016
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}
You May Also Like