How to modify network card bindings via script or command line

I have been scratching my head trying to find a way to change protocol bindings via group policy. I ended up finding a tool designed to be used on server core (no gui). (For anyone that doesn’t know, to see your Nic binding order, go to Network connections and Change adapters (under 7/8 and 2008/12). Press the Alt key once and a menu appears, go on Advanced, then Advanced Settings, Adapters and Bindings tab)

nvspbind.exe has multiple options to change your network settings.

http://archive.msdn.microsoft.com/nvspbind
Usage: nvspbind.exe [option] [NIC|*] [protocol|*]

Options:
/n display NIC information only
/u unbind switch protocol from specified nic(s)
/b bind switch protocol to specified nic(s)
/d disable binding of specified protocol from specified nic(s)
/e enable binding of specified protocol to specified nic(s)
/r repair bindings on specified nic(s)
/o show NIC order for specified protocol
/+ move specified NIC up in binding order for specified protocol
/- move specified NIC down in binding order for specified protocol
/++ move specified NIC up to top of binding order for specified protocol
/– move specified NIC up to bottom of binding order for specified protocol

I will highlight the ones I used.

This one below lists adapters for this protocol (IPv4)
nvspbind /o ms_tcpip

This lists the same but for IPv6
nvspbind /o ms_tcpip6

The order may be different and i’m not sure why. In my script I ended up using the same command on both to make all things equal.

Below is my quick batch I used (note I added another part to my gpo to copy the nvspbind.exe to c:\windows\system32 on the workstations so I don’t have to specify the path to the app. To minimize network traffic I do use If Exist before copying.)

REM **************************************************************** Wireless Network Connection ***************************************************************************** nvspbind /++ “Wireless Network Connection” ms_tcpip
nvspbind /++ “Wireless Network Connection” ms_tcpip6

REM **************************************************************** Local Area Connection ***************************************************************************** nvspbind /++ “Local Area Connection” ms_tcpip
nvspbind /++ “Local Area Connection” ms_tcpip6

I wanted wireless 2nd. My quick way was to use the /++ option to move wireless to the top first and then use /++ again on Local Area Connection to put that up above Wireless.

My next step is a slightly different subject, I’d like to find a way to disable IPv6 though not much luck with the app so far. It will be a future posting.