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 Name
foreach ($VM in $VMstoMove)
{
write-host $VM
$vmobj = get-vm -Name $VM
$newpath = "F:\VMs\" + $VM
Move-VMStorage -DestinationStoragePath $newpath -VM $vmobj
}
0 comments
Hide comments