Replace existing NIC of Azure Virtual Machine (ARM) with PowerShell

Sometimes we just need to do something dumb. For instance, recently I have changed default DNS settings of network adapter on client OS (Windows Server 2016) side of my Azure VM. Next moment, the RDP connection has failed and I couldn’t reconnect again.

The first idea was to replace NIC to another one, which should be recognized by client OS as a new one with default “auto” DNS settings. Well, actually the first idea was to reboot the VM, but it didn’t help.

So let’s see how to replace an existing NIC on Azure VM.

Continue reading