Como definir a ordem de prioridade de conexão de rede em janelas com script wmic ou VB?

1

No Windows por meio de "Adaptadores de rede > Configurações avançadas ... > Adaptadores e ligações > Conexões" Eu posso definir a ordem de prioridade da conexão de rede (não quero dizer a ordem do provedor!).

Mas como posso fazer isso com o wmic ou a partir de um script VB (se possível) para automatizar esse processo?

    
por becks21 07.10.2015 / 08:46

1 resposta

0

Como posso definir a ordem de prioridade de conexão de rede na linha de comando

Você pode fazer o download da nvspbind da Microsoft para fazer isso.

It can be used to enable or disable specific bindings on any NIC and to query and change the NIC connection order.

Veja as opções /+ , /++ , /- e /-- .

Exemplo:

Defina a prioridade da "Conexão de rede sem fio" na parte superior da ordem de vinculação:

nvspbind.exe /++ "Wireless Network Connection" ms_tcpip

Ligação VSP de Rede Hyper-V (nvspbind)

nvspbind is a tool for modifying network bindings from the command line. It is especially useful in Server Core environments with the Hyper-V role enabled.

It can be used to set the correct bindings for NICs used in Virtual Networks.

It can also be used to enable or disable specific bindings on any NIC and to query and change the NIC connection order.

It utilizes the INetCfg APIs documented on MSDN (http://msdn.microsoft.com/en-us/library/ms805265.aspx).

Most options are documented in the readme and nvpsbind.txt which download with the install.

To get help run nvspbind.exe /?

C:\>nvspbind /?

Hyper-V Network VSP Bind Application 6.1.7690.0.
Copyright (c) Microsoft Corporation. All rights reserved.

Usage: nvspbind 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 down to bottom of binding order for specified protocol

There are three variations:

  1. Microsoft_Nvspbind_package.EXE is the standard 64 bit version for server core.

  2. 32bit_Nvspbind_package.EXE is a 32 bit version that works on Vista and newer.

  3. XP_Nvspbind_package.EXE is a reduced functionality 32 bit version that works on XP and newer.

Although I work for Microsoft as a developer on the Hyper-V team, I must point out that as the license tab indicates this tool and documentation are provided "as-is". You bear the risk of using it. No express warranties, guarantees or conditions are provided. It is not supported or endorsed by Microsoft Corporation and should be used at your own risk.

Verified on the following platforms

Windows Server 2012     Yes
Windows Server 2008 R2  Yes
Windows Server 2008     Yes
Windows Server 2003     No
Windows 8               Yes
Windows 7               No
Windows Vista           No
Windows XP              No
Windows 2000            No 

This script is tested on these platforms by the author. It is likely to work on other platforms as well.

Fonte nvspbind

    
por 07.10.2015 / 09:38