Step 2

Clear the hidden network card

Windows sees the new VM's network card as a new device, often named "Ethernet 2". The old card is hidden but still holds the static address, so Windows refuses to reuse it.

10 minutesInside the VM, as an administrator

Find the hidden card

Inside the VM
Get-PnpDevice -Class Net | Select-Object Status, FriendlyName, InstanceId

The live card shows Status OK. The old one shows Unknown, with an InstanceId that starts VMBUS.

Remove it

Inside the VM
pnputil /remove-device "VMBUS\{...}\{...}"    # the InstanceId of the Unknown card
Remove only the hidden Hyper-V card

Leave every device with Status OK alone, and anything that does not start with VMBUS.

Or use Device Manager: View › Show hidden devices › Network adapters › right-click the greyed-out Hyper-V card › Uninstall device.

Put the address back

Select the card by MAC address, so the name "Ethernet 2" does not matter.

Inside the VM
Get-NetAdapter | Select-Object Name, MacAddress, Status
$if = (Get-NetAdapter | Where-Object Status -eq "Up").ifIndex
New-NetIPAddress -InterfaceIndex $if -IPAddress 10.0.20.10 -PrefixLength 24 -DefaultGateway 10.0.20.1
Set-DnsClientServerAddress -InterfaceIndex $if -ServerAddresses 10.0.20.11, 127.0.0.1

Check the server

Inside the VM
ipconfig /all
ipconfig /registerdns
dcdiag /q    # on a domain controller

Done when

Check

The server has its old address back, and Get-PnpDevice -Class Net lists no card with Status Unknown.

Your progress is kept in this browser only.