Remove the VM's definition, rename its files and build a new VM that uses the same disk. Windows inside the disk is untouched.
Note the settings and shut down
Hyper-V host
$old = "OLD-DC-01"; $new = "CON-DC-01"; $root = "D:\VMs" Get-VM $old | Select-Object Generation, ProcessorCount, MemoryStartup, DynamicMemoryEnabled Get-VMNetworkAdapter -VMName $old | Select-Object SwitchName Get-VMNetworkAdapterVlan -VMName $old Stop-VM $old
Remove the VM and rename the files
Remove-VM deletes the VM's settings and leaves the disk file alone.
Hyper-V host
Remove-VM $old -Force Rename-Item "$root\$old" $new Rename-Item "$root\$new\$old.vhdx" "$new.vhdx"
If the disk sits in a subfolder such as Virtual Hard Disks, adjust the second path to match.
Create the new VM around the disk
Hyper-V host
New-VM -Name $new -Generation 2 -Path $root -MemoryStartupBytes 4GB ` -VHDPath "$root\$new\$new.vhdx" -SwitchName "CON-LAN" Set-VMProcessor -VMName $new -Count 2 Set-VMMemory -VMName $new -DynamicMemoryEnabled $false -StartupBytes 4GB Set-VM -Name $new -CheckpointType Disabled Disable-VMIntegrationService -VMName $new -Name "Time Synchronization" Set-VMFirmware -VMName $new -FirstBootDevice (Get-VMHardDiskDrive -VMName $new) Start-VM $new
Use the same generation as before, and put back any VLAN setting you noted in step 1.
Done when
Check
The VM starts and Windows loads. It has no network yet; the next page fixes that.


