6

Is there a way to change the network adapter name in batch or powershell script? possibly by specifying a connection number ?

Thanks in advance.

1 Answer 1

12

Easy enough without PowerShell:

netsh interface set interface name="Old Name" newname="New Name"

Easy enough with PowerShell:

Get-NetAdapter -Name "Old Name" | Rename-NetAdapter -NewName "New Name"

Of course, in PS, you can also select your adapter by whatever property you see fit.

Get-NetAdapter -InterfaceIndex 12 | Rename-NetAdapter -NewName "New Name"

Swiped from Technet Blogs, which has a couple of other more complicated ways.

11
  • 2
    While PowerShell is only supported in Windows8+ AFAIK
    – MichelZ
    Apr 3, 2014 at 17:04
  • @michelZ Powershell has been installed by default since Windows 7, and can be installed on OS as early as windows XP.
    – MartinC
    Apr 3, 2014 at 17:27
  • I'm refering to this article: technet.microsoft.com/en-us/library/jj130867.aspx, saying that it is supported from Windows 8 / 2012 onwards. Just because you can install PowerShell does not mean that all commands work magically, I think
    – MichelZ
    Apr 3, 2014 at 17:29
  • 1
    I did install it, but I can't get Get-NetAdapter to work :) $PSVersionTable.PSVersion 4.0.-1,-1 Get-NetAdapter: The term 'get-netadapter' is not recognized [...]
    – MichelZ
    Apr 3, 2014 at 17:48
  • 1
    I suspect these cmdlets are only available on 8+/2012+, even if you do install PS 4.0. In case you're using an older OS, netsh or WMI (see the linked technet blogs article) should work. Apr 3, 2014 at 20:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .