Windows Server 2012R2: Cannot rename network connection

After migration of VM from one HyperV to another (especially if you do something like Server 2008 -> 2012) I needed to recreate network adapters.

I wanted the same name for network adapters but I got the „cannot rename this connection. A connection with the name you specified already exists error“

Cannot_Rename_conn_1

This is because I haven`t uninstalled old NICs, I just added new ones.

First method is simple. Show hidden devices is Device Manager and delete any network cards that are not present.
Open command prompt and enter following command

set devmgr_show_nonpresent_devices=1

Cannot_Rename_conn_2

Control Panel | Administrative Tools | Computer Management | Device Manager | from menu on top of the screen under View choose Show hidden devices |you should see uninstalled adapters as greyed out, unfortunately I don`t see any and still have the problem.

Cannot_Rename_conn_3

 

Next try for me is https://support.microsoft.com/en-us/kb/311272

DevCon utility

Go to the path where you extracted binaries

First enter following command:

devcon listclass net

Cannot_Rename_conn_5

Then enter :

devcon findall =net

Cannot_Rename_conn_6

Compare first list with second one, and enter instance ID from the second list that you don`t see in first in the following command:

devcon -r remove<instance ID>

good example of command is (devcon -r remove “@PCI\VEN_10B7&DEV_9200&SUBSYS_00D81028&REV_78\4&19FD8D60&0&58F0”)

 

If this method didn`t work there is another one (third one is a charm)
Run |regedit
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Network\{4D36E972-E325-11CE-BFC1-08002BE10318}
Go through the subkeys, expand every key and open Connection Key, look into String Value Name and find the ones that are bothering you. Delete GUID key under which you find old names that you wish to add to new adapters.

Cannot_Rename_conn_7

Third method worked for me. One of these should work in case you have a problem with missing network adapters.

 

Disclaimer