Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • 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 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.

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

Related Reading

Configuring Event Viewer Log Size on Windows

May 24, 2023

How to Detect Who Changed the File/Folder NTFS...

May 24, 2023

Enable Single Sign-On (SSO) Authentication on RDS Windows...

May 23, 2023

How to Create, Change, and Remove Local Users...

May 17, 2023

Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows

May 16, 2023

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

  • Configuring Event Viewer Log Size on Windows

    May 24, 2023
  • How to Detect Who Changed the File/Folder NTFS Permissions on Windows?

    May 24, 2023
  • Enable Single Sign-On (SSO) Authentication on RDS Windows Server

    May 23, 2023
  • Allow Non-admin Users RDP Access to Windows Server

    May 22, 2023
  • How to Create, Change, and Remove Local Users or Groups with PowerShell?

    May 17, 2023
  • Fix: BSOD Error 0x0000007B (INACCESSABLE_BOOT_DEVICE) on Windows

    May 16, 2023
  • View Success and Failed Local Logon Attempts on Windows

    May 2, 2023
  • Fix: “Something Went Wrong” Error When Installing Teams

    May 2, 2023
  • Querying Windows Event Logs with PowerShell

    May 2, 2023
  • Configure Windows LAPS (Local Administrator Passwords Solution) in AD

    April 25, 2023

Follow us

  • Facebook
  • Twitter
  • RSS
Popular Posts
  • Manage Windows Updates with PSWindowsUpdate PowerShell Module
  • Configuring Port Forwarding in Windows
  • Start Menu or Taskbar Search Not Working in Windows 10/11
  • How to Delete Old User Profiles in Windows?
  • Adding Drivers into VMWare ESXi Installation Image
  • Configuring SFTP (SSH FTP) Server on 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