Windows assumes that if a driver says it supports sleep states it handles this correctly, but this setting is known to cause some spontaneous disconnects with the access point (AP). Optionally Windows can be configured to place the WiFi adapters in device power state D4 (Off).
I wrote a PowerShell script that disables the “Allow the computer to turn off this device to save power” setting for all WiFi adapters (contact me if you want it to disable ALL network adapters).
Allow the computer to turn off this device to save power
According to KB2740020 this setting changes the behavior of when power needs to be saved (for instance when a computers enters the S3 sleep mode), it does not mean Windows will turn of this device when it wants to save power. If you read the setting you could assume that Windows does turns off a device when it tries to reduce power consumption, in fact that’s what some people do experience. It gets worse:
|Enabled / Checked||When the machine goes into sleep mode the device power state is changed from D0 to D3 (sleep).|
|Disabled / Unchecked||When the machine goes into sleep mode the device power state is changed from D0 to D4 (off).|
So when the setting allow the computer to turn off this device to save power is enabled it actually puts it to sleep, not turn off. The result is an inverse of what it says :-/
Strangely enough later on the same article explains that by setting a certain registry value (PnPCapabilities) to 24 it will prevent Windows from turning off the network adapter (and use Wake-on-LAN). Either way, I created the script and applied it.
So I wrote a PowerShell script that queries all available WiFi adapters and disables the Allow the computer to turn off the device to save power.
The script runs without arguments but requires elevated privileges, this is enforced by the script.
You can download the files here: DisablePowerSavingForWLAN