Shutting off WiFi when connected to a wired connection

In the company I work for we commonly have laptops that are connected to a wired connection and are also connected to WiFi.  This isn’t good practice and DNS gets a little weird when it gets registered IP addresses from both the WiFi adapter and a registration from the wired connection.  I have been using a VB script from intelliadmin that monitors the wired connection and disables the WiFi adapter when the wired connection is plugged in which works great.  You can do as intelliadmin suggests and run it as a group policy computer configuration logon script.  The problem that I ran into with that method is that as group policy runs when a computer starts up if it’s not connected to the network the script wouldn’t run.  Even worse I ran into issues where the user would have their computer connected to a wired connection and shut it off with the wireless connection still disabled. If the user booted up off-network they would call in complaining they had no WiFi.  The solution was to copy intelliadmins vb script local and run as a scheduled task on the local machine.

  1. Use the below batch script to copy the file somewhere local on the machine.  Set this up as a computer startup script via GPO.
xcopy \\domain.com\sysvol\startupscriptgpolocation\netswitch.vbs "%ALLUSERSPROFILE%\scripts\" /D

2. Then setup a scheduled task up via group policy to run the script as system with the
action setup as start a program with the program/script (If you need help see this                    TechNet article) “%ALLUSERSPROFILE%\scripts\netswitch.vbs” and your parameters          (i.e.  “Local Area Connection” “Wireless Connection”).

Now whether your users are off-network or on-network, they will only use the WiFi adapter when an Ethernet Connection is unavailable.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s