Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2012
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

January 11, 2023 PowerShellWindows 10Windows 11

Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

I have noticed a strange thing: my brand new Lenovo laptop loses Internet connection over a Wi-Fi adapter after waking up from sleep or hibernation. The network connection status shows “No internet access” or “Limited” after waking up. For some reason, the wireless adapter cannot automatically connect to my home Wi-Fi access point, and the list of available wireless networks is empty. If I correctly restart Windows with the shutdown -f –r -t 0 command, Windows automatically connects to my Wi-Fi network and I can access the Internet at once as usual. The issue is quite annoying because I need to restart the laptop several times a day

In this post, I will show you how I managed to fix the problem of losing the Wi-Fi connection in Windows 10 or 11 after resuming from sleep or hibernation.

Contents:
  • Update or Roll Back the Wi-Fi Adapter Drivers
  • Disable Power Saving Mode for Wireless Adapters in Windows
  • Disable and Enable Wi-Fi Adapter in Windows
  • Restart WLAN AutoConfig Service on Windows

Update or Roll Back the Wi-Fi Adapter Drivers

Prior to moving to the next method, try to download and install the latest version driver for your Wi-Fi adapter drivers from the vendors’ website. If the Wi-Fi disconnection issue appeared suddenly on your Windows device, Windows probably recently automatically updated your wireless adapter driver. So, you should try to use an older version of the driver that remained in the local driver repository on your computer (see this driver rollback example).

If you have found a suitable driver and the Wi-Fi connection is not lost with it, it is recommended to prevent Windows from automatically updating the driver for this device.

Disable Power Saving Mode for Wireless Adapters in Windows

By default, the power saving mode is enabled in Windows for most classes of hardware. Windows can automatically turn off devices in order to save laptop battery power. Try to disable the power-saving mode for your wireless network adapters. Possibly due to incorrect firmware or driver, your wireless NIC adapter cannot resume after waking up from sleep mode.

  1. Open the Device Manager (devmgmt.msc);
  2. Expand the Network Adapters section and find your Wi-Fi adapter (usually it has Wireless or 802.11 in its name), then open its properties;
  3. Go to the Power Management tab and uncheck Allow the computer to turn off this device to save power. Save the changes by clicking OK. Allow the computer to turn off this device to save power
If you have multiple network adapters in your computer/laptop, including the Ethernet NICs (for example, Realtek PCI-E Controller), you must disable power saving mode in their properties as well.

It is also recommended to change power-saving options. Go to the Control Panel -> Power Options -> Change plan settings -> Change advanced power settings -> Wireless adapter settings -> Power saving mode -> set Maximum performance.

You can quickly access the Power Options dialog. Press Win+R -> and run the command:

control.exe powercfg.cpl,,3

wireless adapter settings - power saving mode set maximum perrformance

You can change the power saving mode using the commands:

  • On battery: Maximum Performance: powercfg /SETDCVALUEINDEX SCHEME_CURRENT 19cbb8fa-5279-450e-9fac-8a3d5fedd0c1 12bbebe6-58d6-4636-95bb-3217ef867c1a 0
  • Plugged in: Maximum Performance: powercfg /SETACVALUEINDEX SCHEME_CURRENT 19cbb8fa-5279-450e-9fac-8a3d5fedd0c1 12bbebe6-58d6-4636-95bb-3217ef867c1a 0

Disable and Enable Wi-Fi Adapter in Windows

In some cases, disabling and enabling the Wi-Fi adapter in Device Manager can help resolve the issue.

  1. Open the Device Manager console;
  2. Find your Wi-Fi network card in the Network Adapter section;
  3. Right-click on it and select Disable device;
  4. Then click again and select Enable Device.disable and enable wifi nic on windows

If the Internet connection is restored after re-enabling the wireless NIC, try restarting the network interface of your Wi-Fi adapter using PowerShell. List available network adapters using PowerShell:

Get-NetAdapter

Find the name of your Wi-Fi adapter, and use it in the following command to restart the wireless network interface:

Restart-NetAdapter -Name your_wi-fi_adaptername -Confirm:$false

powershell: restart wifi adapter

You can create a text file on the desktop with *.bat extension and code:

powershell.exe -noprofile -executionpolicy bypass –Command "Restart-NetAdapter -Name your_wi-fi_adaptername -Confirm:$false"

restart wifi network manually with bat file

Now, after waking up from sleep mode, all you have to do is click on your restart-wifi.bat file and run it as an administrator. This will restart your wireless network connection.

If you’re getting the Can’t connect to this network error when connecting to a saved Wi-Fi network, follow the steps in this article.

Restart WLAN AutoConfig Service on Windows

In my case, all methods discussed above did not help. As it turned out, the problem was related to the WLAN AutoConfig service.

WLAN AutoConfig service is used on Windows to manage wireless connections (Wi-Fi and Bluetooth). It is the WlanSvc that is responsible for detecting, connecting, and disconnecting from wireless networks. Also, it allows to create software access point (Hotspot) on Windows. If you stop the service, Windows won’t be able to see wireless networks and connect them.

After waking up from Sleep, open the list of services on your computer (Win+R -> services.msc) and find “WLAN AutoConfig” in the list. Make sure that it is configured to start automatically. Try to restart it. In my case, I couldn’t do it. When trying to restart/start the service, the following message appeared:

Windows could not start the WLAN AutoConfig service on Local Computer.

Windows could not start the WLAN AutoConfig service on Local Computer

The WlanSvc starts successfully only when the computer is restarted. I found out that the svchost.exe process of WlanSvc hangs on after hibernation and sleep. It is C:\windows\system32\svchost.exe -k LocalSystemNetworkRestricted –p (you can see this path in the service properties).

wlansvc service - wireless manager in Windows 10

Try to kill the process with the Task Manager (Ctrl+Shift+Esc). Find Service Host: Local Service -> WLAN AutoConfig in the Processes tab, select Details in the context menu and end the process by clicking End Task. You should then be able to start the WlanSvc service from the service management console or using PowerShell:

Start-Service -Name WlanSvc -PassThru

end wlan autoconfig svchost process

I wrote a simple PowerShell script to run as administrator when Windows wakes up from hibernation or sleep. The script restarts the WLAN AutoConfig service:

$WLANProc = Get-CimInstance Win32_Process | Where-Object {$_.CommandLine -eq "c:\windows\system32\svchost.exe -k LocalSystemNetworkRestricted -p"}
Stop-Process -Id $WLANProc.ProcessId -Force
Start-Service WlanSvc

powershell script to restart WLAN AutoConfig

You may also need to restart your Wi-Fi adapter:

restart-netadapter -InterfaceDescription 'your_wireless_adapter_name' -Confirm:$false

You can automatically run a script on a Windows Event trigger by binding it to an event with code 1 from the Power-Troubleshooter source in the System log (this event appears in the Event Viewer after the wakeup from hibernation or sleep mode).

It is the last method that helped me to fix the issue with the loss of the Wi-FI network after waking up from sleep on Windows 10.

Additional fixes you can try if your laptop loses Internet (Wi-Fi) connection after sleep

  • Use the Network Troubleshooter on Windows to fix network adapter/stack problems. Run the command msdt.exe -id NetworkDiagnosticsNetworkAdapter and follow the wizard instructions;run network troubleshooter in windows
  • Reset network and TCP/IP stack settings on Windows ( ms-settings:network -> Network reset -> Reset now);
  • Disable Fast Startup on Windows 10/11: powercfg.cpl -> Choose what the power buttons do -> Change settings that are currently unavailable, disable the option Turn on fast startup (recommended);disable fast startup in windows
  • Open the Local Group Policy Editor console (gpedit.msc) and navigate to Computer Configuration -> Administrative Templates -> System -> Power Management -> Sleep Settings. Enable the following GPO options: gpo: enable network standby in sleep mode
    Allow network connectivity during connected-standby (plugged in)
    Allow network connectivity during connected-standby (on battery)

    This will allow the laptop to maintain an active network connection even in sleep mode.

  • If your computer has both a wireless (Wi-Fi) connection and a wired connection active at the same time, check to see if Wi-Fi is turned off automatically when the Ethernet LAN cable is connected.

11 comments
22
Facebook Twitter Google + Pinterest
previous post
Adding Trusted Root Certificates on Linux
next post
Fix: Can’t Extend Volume in Windows

Related Reading

Configure User’s Folder Redirection with Group Policy

February 3, 2023

Disable Built-in PDF Viewer in Microsoft Edge

February 3, 2023

Join a Windows Computer to an Active Directory...

February 2, 2023

Using Previous Command History in PowerShell Console

January 31, 2023

How to Install the PowerShell Active Directory Module...

January 31, 2023

11 comments

Mark July 1, 2020 - 11:30 am

Awesome advice – really helpful in fixing the same problem on my Lenovo. Thank you!

Reply
Nick Gilbert November 16, 2020 - 12:16 pm

The last tip worked and after three days laptop went back to sometimes not connecting from sleep mode? Any thoughts please.

Reply
alex November 20, 2020 - 9:19 am

I have same problem in Win10 on acer latop. It looks like that wifi become fly mode and cannot be closed

Reply
Peter December 14, 2020 - 10:36 am

I have the same problem as Alex.

Reply
An January 21, 2021 - 7:27 am

THANK YOU! Lenovo laptop as well. So far so good.

Reply
Zonal March 21, 2021 - 4:22 pm

Same issue with my Lenovo. Happened after another damned forced windows update.

Thanks for the solution

Reply
Amey April 17, 2021 - 6:48 pm

Tried a lot of fixes but none worked. Tried this solution and it seems to be working. Mine is a Asus gaming laptop.
THANK YOU.

Reply
Roger June 10, 2021 - 2:44 pm

So many people report this problem, so why the **** don’t Microsoft just fix the bug once and for all??? Having finally taken the leap from Windows 7 (excellent) to Windows 10 (flaky) due to the former being out of support I am exceedingly disappointed at some of the frustrating faults with this rather shoddy operating system. Microsoft – wake up and sort it out!

Reply
Jim August 21, 2021 - 3:32 pm

I’ve been dealing with this for months. When the computer awakes from sleep the adapter network gives error can’t connect to this network on 5ghz Only way I can resolve it is by going into my router and renaming the network. This is clearly a windows 10 problem.

Reply
D January 9, 2022 - 12:03 am

The last option i.e. configuring the WLAN AutoConfig service to start automatically worked for me. Thank you ! Nothing else worked. In fact I don’t even see some of the options listed here and elsewhere e.g. the ‘Power Management’ tab for the network adapter.

Reply
André November 19, 2022 - 1:05 pm

Thanks for this very thoroughly described fix, and the alternatives you provided. I just wish that Microsoft had the qualifications on board to explain issues this way, that would make troubleshooting the many irritating issues so much easier.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • Configure User’s Folder Redirection with Group Policy

    February 3, 2023
  • Using Previous Command History in PowerShell Console

    January 31, 2023
  • How to Install the PowerShell Active Directory Module and Manage AD?

    January 31, 2023
  • Finding Duplicate E-mail (SMTP) Addresses in Exchange

    January 27, 2023
  • How to Delete Old User Profiles in Windows?

    January 25, 2023
  • How to Install Free VMware Hypervisor (ESXi)?

    January 24, 2023
  • How to Enable TLS 1.2 on Windows?

    January 18, 2023
  • Allow or Prevent Non-Admin Users from Reboot/Shutdown Windows

    January 17, 2023
  • Fix: Can’t Extend Volume in Windows

    January 12, 2023
  • Wi-Fi (Internet) Disconnects After Sleep or Hibernation on Windows 10/11

    January 11, 2023

Follow us

woshub.com
  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Configuring Port Forwarding in Windows
  • Manage Windows Updates with PSWindowsUpdate PowerShell Module
  • Start Menu or Taskbar Search Not Working in Windows 10/11
  • Configuring SFTP (SSH FTP) Server on Windows
  • Adding Drivers into VMWare ESXi Installation Image
  • How to Delete Old User Profiles in Windows?
  • How to Find the Source of Account Lockouts in Active Directory?
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top