- Real world Windows experiences
- Wednesday, November 01, 2006
- Changing Network Provider order in Windows
- 19 Comments:
- Is there a way to change network provider order in Windows 7?
- Windows network provider order
- Вопрос
- Ответы
- How to change the priority order of network adapters on Windows 10
- How to change network adapter priorities using Control Panel
- How to change network adapter priorities using PowerShell
- More Windows 10 resources
- Add the best VR headset to your Microsoft Flight Simulator experience
- The Dell XPS 15 is our choice for best 15-inch laptop
- Halo: MCC’s live service elements make it better, not worse
- These are the best PC sticks when you’re on the move
Real world Windows experiences
Wednesday, November 01, 2006
Changing Network Provider order in Windows
Problem: I needed to put the «Microsoft Windows Network» network provider on top of the other (Novell Netware) providers. This is to get rid of the 15 second delay the Novell client does when trying to access a Windows file server.
This is pretty easy to do manually (Network Connections->Advanced->Advanced Settings->Provider Order), but a little more difficult to do manually. The registry key «HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\ProviderOrder» lists the providers as a comma separated string, for example «NetwareWorkstation,RDPNP,LanmanWorkstation,WebClient»
Unfortunately, the installed providers aren’t really predictable. For example, if the computer has PointSec drive encryption installed, a provider named «PssoCM32» is listed somewhere in the end of the string.
Solution: Read the string from the registry, split it up, create a new string beginning with «LanmanWorkstation» (which of course is the «Microsoft Windows Network» provider), attach the rest of the providers to the new string, in the same order they were originally listed.
VBScript Code (successfully made unreadable by blogger.com, but is copy-pasteable to Notepad):
‘
‘ ChangeProviderOrder.vbs, by Anders Olsson, Kentor Teknik AB, 2006-10-31
‘
‘ Reads the «Network provider order» from the registry and reorders it putting
‘ the «Microsoft Windows Networking» provider on top.
‘
‘ Example: Before — «NCredMgr,NetwareWorkstation,RDPNP,LanmanWorkstation,WebClient»
‘ would become «LanmanWorkstation,NCredMgr,NetwareWorkstation,RDPNP,WebClient» after
‘ running this script.
‘
Set WshShell = WScript.CreateObject(«WScript.Shell»)
‘ Read the reg value of the providers
strKey = WshShell.RegRead(«HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\ProviderOrder»)
‘ Split the strings up using comma (ASCII #44) as the delimiter
arrProvs = Split(strKey, chr(44), -1, 1)
‘ If LanmanWorkstation is already first, we don’t have to do anything
If arrProvs(0) = «LanmanWorkstation» Then
Wscript.Quit(0)
end if
‘ «LanmanWorkstation» should always start the string
strNewProvs = «LanmanWorkstation»
‘ Loop through the old provider strings, and add them to the new string. Don’t
‘ write LanmanWorkstation, since it’s already written at the start of the string.
For Each strProv In arrProvs
Select Case strProv
Case «LanmanWorkstation»
Case Else strNewProvs = strNewProvs & «,» & strProv
End Select
Next
‘ Write the new string back to the registry
WshShell.RegWrite «HKLM\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order\ProviderOrder», strNewProvs, «REG_SZ»
posted by Anders Olsson at 12:10 AM
19 Comments:
28 September, 2007 10:54 Anonymous said.
Thanks, that proved useful. I added the following code to detect machines where LanmanWorkstation was not installed.
‘ Check if LanmanWorkstation is a configured provider and quit if not configured
If InStr(strKey,»LanmanWorkstation»)= 0 Then
WScript.Quit(0)
End If
11 April, 2008 08:14 Unknown said.
Thanks so much dude, super script!
30 May, 2008 07:43 gabriellus said.
I copy and paste the code into a .vbs text file in XP, and when I double-click the saved file, it does nothing. In Task Manager, wscript.exe pops up and closes after a moment. Also, the changes are not occurring. What’s going on here? Is there something in this code that has been deprecated?
21 April, 2009 11:07 Anders Olsson said.
Try running it from a command window and see if it returns any error messages.
21 April, 2009 11:38 Anonymous said.
copy-paste-run-worked. thanks for the script!
08 May, 2009 09:25 Impish said.
Great work Thanks !
30 September, 2009 00:42 Anonymous said.
How would you do the opposite of moving a specific entry down to the bottom(last) if found in the provider list?
18 November, 2009 12:43 Anonymous said.
A slight modification that bypasses the error checking and makes it easier to customize:
For Each strProv In arrProvs
Select Case strProv
Case «LanmanWorkstation» strFirst = strProv
Case «Some Other Provider» strSecond = «,» & strProvider
Case Else strTail = strTail & «,» & strProv
End Select
Next
strNewProvs = strFirst & strSecond & strTail
12 March, 2010 14:15 Anonymous said.
thank you so much, ran into same problem with Novell here!
06 April, 2010 06:34 Reinhard en Tanita said.
Thank you, this works GREAT on Windows XP.
I tried it on Windows 7 as well and the very same VB Script gives an error:
Line 38 Char 117
Error: Expoected end of statement
Code: 800A0401
Source: Microsoft VB Script compilation error
Any ideas if VB Script on Win 7 needs to look different or have something extra in it to work?
Thanks a million,
Reinhard
05 May, 2011 02:09 Reinhard en Tanita said.
Awesome, thanks ! Worked brilliantly !!
05 May, 2011 02:16 Anonymous said.
Does anyone know what RDPNP is?
15 July, 2011 07:53 Scott said.
Anyone got a powershell script that can do this
Im getting stuck with splitting the stirng once i have it in the array (the easy part:)
21 February, 2012 21:31 Anonymous said.
Worked great, thank you!
29 February, 2012 11:30 Unknown said.
Thanks for sharing..
‘ 2012-07-11 DS — Per http://support.microsoft.com/kb/832161
‘ Added logic to support additional load order priorities, if exist
‘ 2012-07-11 DS — Per http://technet.microsoft.com/en-us/library/cc959369.aspx
‘ Added logic to verify Service Key and NetworkProvider group membership for each element
11 July, 2012 20:39 Anonymous said.
Even today I used this on XP pc’s, years after posting.
Thanks a million!!
15 November, 2013 03:29 Anonymous said.
This really saved us with our Novell to Active Directory migration. Thanks a ton!
19 March, 2014 08:53 Darklurker said.
Here is a batch file that will do this as well. Took me the better part of the day to work out all of the FOR loops and get it down. It seems to work fine on XP, but UAC interferes on Win7/8 (probably Vista too).
I went the batch file route because I was afraid some of our computers would start throwing up weird warnings if I asked my users to run a VBS. Too bad UAC causes similar problems. But eh, OK.
I’m still working on a way around UAC.
set basekey=hklm\system\currentcontrolset\control\networkprovider\order
set regquery=reg query %basekey% /v providerorder
set ms=LanmanWorkstation
rem We use a for loop to execute the «reg query» and loop through each line of output.
rem We are assuming that the last line from the reg output is the only one we want.
rem The FOR loop overwrites instring each time, so only the last one gets kept
for /F «delims=» %%i in (‘%regquery%’) do set instring=%%i
rem put each word in the string into a variable, and keep count of their number
set wordcount=1
For %%j in (%instring%) Do (
set w!wordcount!=%%j
Set /A wordcount+=1
)
rem NOTE: at this point, the words from the registry value are in the «w» variables
rem starting at w3. W1 and w2 contain «ProviderOrder» and «REG_SZ», which we don’t
rem need.
rem a quick check — if mslanmanclient is already word #3, we don’t need to do anything
if /I %w3%==%ms% (
echo Your computer already has the Microsoft provider in spot 1. Exiting now.
goto end
)
rem subtract one to allow for the extra increment before we exited the for %%j loop above.
rem this is for the for /L loop below, so it doesn’t run off the end of the tracks.
set /A wordcount-=1
rem I thought this would be the easy part. 😉
rem how to explain this? eh, loop through each word starting at w3.
rem If the word does not equal mslanmanclient, add it to outstring.
rem have to delayexpand outstring below, or it only grabs the last word.
for /L %%k in (3,1,%wordcount%) do (
if /I not «!w%%k!»==»%ms%» set outstring=!outstring. w%%k!
)
echo outstring is %outstring%
rem now run reg to update the value
rem this is where Windows UAC will bite you in the buttocks. Runs fine on XP though.
reg add %basekey% /v providerorder /d %outstring%
Is there a way to change network provider order in Windows 7?
Hi Sean Wallent,
Welcome to Microsoft Answers.
I would suggest you to try the following steps and see if that help.
1. Go to start
2. Type “view network connections” in search and click on that selection
3. Press “ALT” > Advanced> Advanced connections
4. Click on Adapters and Bindings Tab and make selection
Note: If you wants to change priority order of Network Provider, you would click “Provider Order” or “Adapters and Bindings” Tab to change binding order
If the above steps fail, i would suggest you to try the following steps.
1. Click on Start > type “network connections” in the search box and then click on “View network connections”
2. Then Click on Organize > Layout > Menu Bar
3. From the menu bar click on Advanced > Advanced settings
4. This will give the order in which the network connections are accessed.
Hope this helps. Let us know the results.
Thanks & Regards,
Vijay B – Microsoft Support
Visit our Microsoft Answers Feedback Forum and let us know what you think
4 people found this reply helpful
Was this reply helpful?
Sorry this didn’t help.
Great! Thanks for your feedback.
How satisfied are you with this reply?
Thanks for your feedback, it helps us improve the site.
Windows network provider order
Вопрос
День добрый, подскажите, пожалуйста, на что влияет изменения порядок сетей в Advanced Settings
Прочитал в книжке, что это в каком порядке будет Name Resolution, только ли?
Также рекомендуется для External сети отключать File and Printing & Client for microsoft network, если я правильно понимаю, это имеется в виду если сеть смотрит на провайдера.
Нигде не ошибся?
Ответы
Не ошибся, рекомендуют отключать, потому, как никому не хочется, чтобы с внешнего интерфейса к нему пришли по SMB чисто позырить, что есть интересного.
Не только, поскольку есть еще такая штука, как опрос сетевых интерфейсов во время включения машины- если, к примеру КД (или TMG) имеет несколько адаптеров( классика жанра), и адаптер, который смотрит в локальную сеть, не стоит в списке первым, то это неероятным образом влияет на скорость поднятия интерфейса- КД будет до умопомрачения искать партнеров по репликации на нем, а ты наблюдать интересный мессадж( подготовка сетевых подключений) В стародавние времена на 2003 DC+ EXC03 занимало до часу времени- непутевый заказчик даже регламент себе закатал окна на врем перезагрузки. Еще забыл про метрику, можно поглядеть тут.
How to change the priority order of network adapters on Windows 10
On Windows 10, if you have a device with more than one network adapter (such as Ethernet and Wi-Fi), each interface receives a priority value automatically based on its network metric, which defines the primary connection that your device will use to send and receive networking traffic.
Although, for the most part, Windows 10 does a pretty good job selecting an optimal connection to access the network, sometimes you may need to configure the order of the network adapters manually. For example, if you want to use a Wi-Fi over an Ethernet interface when both adapters are connected to the network.
You could disable those adapters you don’t use, but it may not be the best solution as you may need them as backups. Instead, a more straightforward solution is to adjust the interface metric to specify in which order your device should use each network adapter, which you can do using Control Panel and PowerShell.
In this Windows 10 guide, we’ll walk you through the steps to change the network adapter priorities to stay connected using your prefered adapter when using multiple interfaces.
How to change network adapter priorities using Control Panel
If you want to change the order in which Windows 10 uses network adapters, do the following:
- Open Settings.
- Click on Network & Internet.
- Click on Status.
Click the Change Adapter options item.
Right-click the network adapter you want to prioritize, and select Properties.
Click the Properties button.
In the «General» tab, click the Advanced button.
In the «Interface metric» field assign a priority value for the adapter.
Quick Tip: The lower the metric number means higher priority, and a higher number indicates lower priority.
Once you’ve completed the steps, Windows 10 will prioritize the network traffic depending on your configuration.
The only caveat using the Control Panel experience is that depending on your network setup, you may need to adjust the metric for the Internet Protocol Version 6 (TCP/IPv6) as well, if that’s the protocol you’re using. (Usually, you will be using the TCP/IPv4 protocol.)
At any time, you can revert the changes using the same instructions, but on step No. 9, make sure to check the Automatic metric option.
How to change network adapter priorities using PowerShell
Alternatively, you can change network adapters priorities on a device with multiple interfaces using PowerShell with these steps:
- Open Start.
- Search for Windows PowerShell, right-click the top result a select Run as administrator.
Type the following command to identify the current interface metric and interface index number and press Enter:
Type the following command to change the priority order of the network adapter and press Enter:
Set-NetIPInterface -InterfaceIndex 21 -InterfaceMetric 10
In the command, make sure to change the -InterfaceIndex value to reflect the network adapter you want to prioritize and change the -InterfaceMetric value to assign a priority. Also, remember that a lower metric number means higher priority, and a higher metric number means lower priority.
Type the following command to see the new metric applied to the network adapter and press Enter:
After completing the steps, Windows 10 will prioritize the network traffic depending on your configuration when multiple network adapters are connected to the network.
At any time, you can go back to the previous behavior allowing Windows 10 to decide the network adapter priority using these steps:
- Open Start.
- Search for Windows PowerShell, right-click the top result a select Run as administrator.
Type the following command to identify the current interface metric and interface index number and press Enter:
Set-NetIPInterface -InterfaceIndex 21 -AutomaticMetric enabled
In the command, make sure to change the -InterfaceIndex value with the correct number of the network adapter you want to apply an automatic metric.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
Add the best VR headset to your Microsoft Flight Simulator experience
Microsoft Flight Simulator is an impressive game on a standard 2D monitor, but have you experienced it within VR? Grab one of these headsets and take off.
The Dell XPS 15 is our choice for best 15-inch laptop
For a lot of people, a 15-inch laptop is a perfect size that offers enough screen for multitasking, and in a lot of cases, some extra performance from powerful hardware. We’ve rounded up the best of the best at this size.
Halo: MCC’s live service elements make it better, not worse
Halo: The Master Chief Collection is more popular than ever, but some fans don’t agree with the live service approach 343 Industries has taken with it. Here’s why those elements are, at the end of the day, great for the game and for Halo overall.
These are the best PC sticks when you’re on the move
Instant computer — just add a screen. That’s the general idea behind the ultra-portable PC, but it can be hard to know which one you want. Relax, we have you covered!