This is a small PowerShell script which allows you to migrate a virtual machine.
For this script to work, the Hyper-V PowerShell module has to be loaded.
#Usage: script.ps1 <vm name> <target path> <target server>
#Example: script.ps1 VM001 E:\Hyper-V Hyperv2
function MigrateVM ($VMName, $TargetPath, $TargetServer)
{
Get-VM -server $VM -vm $VMName | invoke-vmshutdown -force -Wait | Export-VM -VM $VMName -Path $TargetPath -Wait | Get-VM -server $TargetServer -vm $VMName | Start-VM -Wait
}

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 