How to automatically disable Wi-Fi when Ethernet is connected? , Ranjan.info

If multiple Wi-Fi networks are available, Windows automatically selects the wireless network with the best signal strength (regardless of the speed of the connection and the number of devices connected to it). However, when you connect your computer (laptop) to a wired Ethernet network, Windows continues to use the Wi-Fi network, although the Ethernet connection has a significantly higher speed, and the connection is more stable and less subject to interference. Does not happen. To switch to a cable Ethernet connection, a Windows user has to manually disable the Wi-Fi connection every time. Let’s see how to automatically turn off Wi-Fi when Ethernet LAN cable is connected on Windows 10 and 11.

WLAN switching option in BIOS/UEFI

Many laptop/desktop vendors have their own implementation of LAN/WLAN switching technology (it may be called differently). This technology states that only one network adapter can simultaneously transmit data to computers. If, while using a Wi-Fi network, a higher priority Ethernet connection appears on the device, the Wi-Fi adapter should automatically go into standby mode. This saves battery life and reduces the load on the wireless network.

You can enable the LAN/WLAN switching option in the BIOS/UEFI settings or in the properties of your wireless network adapter driver (depending on your hardware vendor).

Restart your computer to enter UEFI/BIOS settings, then find and enable LAN/WLAN switching option (on HP devices) or wireless radio control (on Dell devices).

Enable LAN/WLAN Switching in BIOS

This feature can be called differently or completely absent in the BIOS / UEFI of other manufacturers.

Disable Wi-Fi on Wired Connect with Wireless Adapter Driver

Some Wi-Fi adapter drivers have an option in their settings to automatically turn off Wi-Fi when a high-speed Ethernet connection is available.

open the windows device Manager ,devmgmt.msc), find your wireless network adapter in network adapters Open the section and its properties. go to advanced tab.

find disabled on wired connect Item in the list of Wi-Fi adapter options. change its value Active and save the driver changes.

Disabled on wired connect - 802.11n wireless adapter option

Thanks to this option, the wireless network driver will disconnect the adapter from the Wi-Fi network when an active Ethernet LAN connection is detected.

Not all Wi-Fi adapter models support this option. For other wireless network adapters, you can automate switching to Ethernet by using a scheduler task or a PowerShell script.

Enable/disable Wi-Fi adapter when connected to LAN with Task Scheduler

Let’s see how to automatically enable and disable Wi-Fi adapters in Windows using special Task Scheduler jobs that bind to Ethernet cable connection / disconnection events (we will use Windows Scheduler event triggers).

The first step is to enable the Wired Autoconfig service (dot3svc) and set it to start automatically. You can check the status of a service and change the startup mode using PowerShell:

Set-Service dot3svc -startuptype automatic -passthru
Start-Service dot3svc
Get-Service dot3svc

Enable Wired-AutoConfig service (dot3svc) in Windows

Now open Event Viewer (eventvwr.msc) and go to Applications and Services Logs -> Windows -> Wired-Autoconfig -> Operational. Here we are interested in the following two events:

  • event id 15501 , The network adapter has been connected.
  • event id 15500 , The network adapter has been unplugged.

Wired-AutoConfig Event ID 15500: The network adapter has been unplugged

In earlier versions of Windows, you needed to use another ID for LAN link connection events (EventID: 32 — Network link is established ) And ( EventID: 27 – Network link is disconnected ,

We’ll bind PowerShell commands to these events to automatically enable and disable the Wi-Fi adapter. To do this, you need to get the name of your Wi-Fi network adapter in Windows. You can list network adapters with PowerShell:

Get-NetAdapter

In our example, the name of the adapter is tplinkwifi,

Get Network Adapter Name in Windows

Click and select event 15501 in the event viewer Attach task to this event,

Attach tasks to events in Event Viewer

Specify the name of the scheduler job DisableWiFi_if_Ethernet_Connected-15501, to select start a program Work as a verb. To disable the Wi-Fi adapter, you need to run the following command:

Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Add argument: -NoProfile -WindowStyle hidden -ExecutionPolicy Bypass -Command &{Disable-NetAdapter -Name TPLinkWiFi -confirm:$False}

Windows Task: Enable WiFi Adapter

Similarly create another scheduler task for event id 15500.

  1. Set job name: EnableWiFi_if_Ethernet_Disconnected-15500
  2. Configure job action:
    command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    argument: -NoProfile -WindowStyle hidden -ExecutionPolicy Bypass -Command &{Enable-NetAdapter -Name TPLinkWiFi -confirm:$False}

In the properties of both functions, go to conditions tab and uncheck Start task only when computer is on AC power alternative.

Disable power dependency in task properties

Now try connecting the LAN cable. After a few seconds, your Wi-Fi adapter will automatically be disabled (status = disabled).

Turn off WiFi when Ethernet cable is connected via Task Scheduler

When Ethernet is disconnected, Tasks enables the wireless adapter and Windows automatically connects to your saved Wi-Fi network.

Turn off Wi-Fi over Ethernet connection using WLAN Manager PowerShell script

To automatically disconnect the Wi-Fi adapter when a computer is connected to a wired Ethernet network, you can use WLAN Manager powershell script. You can find a new WLAN Manager version with enhanced Windows 10 support and correct identification of virtual adapters on GitHub: https://github.com/jchristens/Install-WLANManager,

This PowerShell script will create a new Scheduler task that periodically checks for active network adapters. If the script detects a LAN (Ethernet) connection, the WLAN interface is automatically disabled. If the Ethernet network cable is disconnected, the script enables the wireless Wi-Fi adapter.

The script consists of two files:

  • PSModule-WLANManager.psm1
  • WLANManager.ps1

you can put WLAN Manager Script on Windows. Open an elevated PowerShell prompt and allow running PS1 scripts:

Set-ExecutionPolicy RemoteSigned

Install the script on Windows with the following command:

.\WLANManager.ps1 -Install:System

The script can be set up to run as a user account (Install:User) or with the privileges of a local system account (Install:System,

Verifying WLAN Manager version information… Missing
Writing WLAN Manager version information… Done
Verify WLAN Manager Files… Missing
Installing WLAN Manager Files… Done
Verify WLAN Manager Scheduled Task… Missing
Installing WLAN Manager Scheduled Task… Done

You can have the script notify the user with a pop-up notification when switching between Wi-Fi and LAN networks:

.\WLANManager.ps1 -Install:User -BalloonTip:$true

make sure a new WLAN Manager The job has appeared in Task Scheduler.

WLAN Manager Tasks in Windows 10

Restart your computer. After startup, the scheduler will start the script C:\Program Files\WLANManager\WLANManager.ps1 which checks for network connections every second, and if a LAN connection is detected, all available Wi-Fi adapters will be disabled. If the LAN cable is disconnected, the script will automatically enable the wireless Wi-Fi adapter.

WLAN Manager Script works well on Windows 11, 10, 8.1 and 7.

tip, To remove the WLAN Manager script, run this command:

.\WLANManager.ps1 Remove:System

Disable non-domain wireless networks when connected to LAN via GPO

There is a separate setting in the GPO that allows you to disable the Wi-Fi connection when the computer is connected to the corporate domain network via the LAN. This policy is located in the following GPO section Computer Configuration -> Policies -> Administrative Templates -> Network -> Windows Connection Manager and calledProhibit connections to non-domain networks when connected to domain certified networks”,

This policy prevents computers from connecting to both a domain network and an untrusted non-domain network at the same time.

gpo: prohibit connections to non-domain networks when connected to domain certified networks

However, when this policy is enabled, you may experience problems connecting to Wi-Fi networks if additional interfaces are present on your computer. For example, loopback interfaces or virtual network adapters from desktop hypervisors (VMware Workstation, Hyper-V, VirtualBox, etc.).

You can also disable the use of Wi-Fi if there is an active Ethernet connection to the LAN domain. You can configure this behavior using the GPO option Reduce the number of simultaneous connections to the Internet or Windows domain Under Computer Configuration -> Administrative Templates -> Network -> Windows Connection Manager. Enable and select the policy 3=Suppress Wi-Fi over Ethernet,

GPO: Prevent Wi-Fi over Ethernet

Leave a Comment