Rename Windows Network Adapter with Powershell

I like my servers configured exactly the way I want – this extends even to minor things like the name of a network adapter interface. I’m slowly rebuilding my lab with the latest versions of ESXi and Microsoft Windows Server 2016. I noticed that my new 2016 servers were creating the network adapter with a name of ‘Ethernet0’ which annoyed me as I want them to just be called ‘Ethernet’. This is very easy to resolve – obviously in the GUI you can just browse to the adapter and rename it but as I am deploying the ‘core’ installation I needed to do it through the command line.

First off I wanted to make sure I had the name correct so I used the PowerShell cmdlet Get-NetAdapter. This returned the required information and I then used the Rename-NetAdapter PowerShell cmdlet with the -Name and -NewName switches to define the old and new interface names.

Get-NetAdapter Rename-NetAdapter

 

Having a consistent naming convention will make scripting easier in future work as I can be assured each VM will have the same name assigned to it’s network interface.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.