Rename a Network Interface from the Command Line

While building a Hyper-V server this week, I decided to rename the network interfaces to something that would make identifying the iSCSI connections a little easier. Since the server was installed with only the core (no GUI) installation of Windows Server 2008 R2, the process had to be performed from the command line. The network interface is also commonly referred to by other names such as network adapter or network connection.

To show a list of the network interfaces, run the following command:

To rename the “Local Area Connection 5” in the image shown above to the name “iSCSI1”, use the following command:

Run the show interface command again to verify the name changed:

Now aren’t the network interface names in the above image a lot easier to deal with than the generic ones shown in the first image?


About Mike F Robbins

Mike F Robbins is a Microsoft MVP on Windows PowerShell and a SAPIEN Technologies MVP. He is a co-author of Windows PowerShell TFM 4th Edition and is a contributing author of a chapter in the PowerShell Deep Dives book. Mike has written guest blog articles for the Hey, Scripting Guy! Blog, PowerShell Magazine, and He is the winner of the advanced category in the 2013 PowerShell Scripting Games. Mike is also the leader and co-founder of the Mississippi PowerShell User Group. He blogs at and can be found on twitter @mikefrobbins.
This entry was posted in Hyper-V Server 2008, Hyper-V Server 2008 R2, Storage Area Network, Windows Server 2008, Windows Server 2008 R2. Bookmark the permalink.

6 Responses to Rename a Network Interface from the Command Line

  1. Seth Fulton says:

    This issue also was tackled a few years back by the scripting guys:

    Does anyone have a PowerShell method they would like to share?

  2. aradillas says:

    How rename a network interface if the user hasn’t administrator rights?

  3. Cheryl says:

    Something like this should work:
    $AdapterToChange = Get-WmiObject win32_NetworkAdapter |where { $_.NetConnectionID -like “Local Area Conn*”}
    $AdapterToChange.netConnectionID = “clb”

  4. Frank says:

    Works fine – thumbs up!
    You are my Hyper-V hero of the day :)

  5. Echo says:

    Any ideas on a automation script that will detect the last installed network, and modify it?

    Say.. if a loopback adapter was installed via DEVCON, the script would need to know the name of the loopback adapter given that it will be different depending on how many current connections the user already has.

  6. Pingback: Enabling Jumbo Frames for iSCSI on Server Core | Mike F Robbins

Leave a Reply