{"id":6845,"date":"2014-05-01T16:06:09","date_gmt":"2014-05-01T14:06:09","guid":{"rendered":"https:\/\/ingmarverheij.com\/?p=6845"},"modified":"2017-10-26T16:36:07","modified_gmt":"2017-10-26T14:36:07","slug":"disable-allow-computer-turn-device-save-power-wifi-adapters","status":"publish","type":"post","link":"https:\/\/ingmarverheij.com\/en\/disable-allow-computer-turn-device-save-power-wifi-adapters\/","title":{"rendered":"Disable &ldquo;Allow the computer to turn off the device to save power&rdquo; for all WiFi adapters"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 5px; display: inline; padding-right: 0px; border: 0px;\" title=\"\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2014\/05\/Green-WiFi.png\" alt=\"\" width=\"144\" height=\"144\" align=\"right\" border=\"0\" \/>When a Windows computer enters sleep mode it ensures that WiFi adapters enters the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/aa932261.aspx\" target=\"_blank\" rel=\"noopener\">device power state<\/a> D3 (Sleep) and on resume ensure it puts it back to the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/aa932261.aspx\" target=\"_blank\" rel=\"noopener\">device power state<\/a> D0 (Full on).<\/p>\n<p>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 <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/aa932261.aspx\" target=\"_blank\" rel=\"noopener\">device power state<\/a> D4 (Off).<\/p>\n<p>I wrote a PowerShell script that disables the \u201c<strong>Allow the computer to turn off this device to save power<\/strong>\u201d setting for all WiFi adapters.<\/p>\n<p><strong><span style=\"text-decoration: underline;\">Update 26\/10\/2017:<\/span><\/strong> Included an option to disable for all network adapters.\u00a0<br clear=\"all\" \/><!--more--><\/p>\n<h1><\/h1>\n<h1>Allow the computer to turn off this device to save power<\/h1>\n<p>According to <a href=\"https:\/\/support.microsoft.com\/kb\/2740020\" target=\"_blank\" rel=\"noopener\">KB2740020<\/a> this setting changes the behavior of when power needs to be saved (for instance when a computers enters the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Sleep_mode\" target=\"_blank\" rel=\"noopener\">S3 sleep mode<\/a>), 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 <em>does<\/em> turns off a device when it tries to reduce power consumption, in fact that\u2019s what some people do experience.\u00a0 It gets worse:<\/p>\n<table border=\"1\" width=\"600\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td valign=\"top\" width=\"163\"><strong>Setting<\/strong><\/td>\n<td valign=\"top\" width=\"437\"><strong>Explanation<\/strong><\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"163\">Enabled \/ Checked<\/td>\n<td valign=\"top\" width=\"437\">When the machine goes into sleep mode the device power state is changed from D0 to <strong>D3 (sleep<\/strong>).<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\" width=\"163\">Disabled \/ Unchecked<\/td>\n<td valign=\"top\" width=\"437\">When the machine goes into sleep mode the device power state is changed from D0 to <strong>D4 (off<\/strong>).<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>So when the setting <strong>allow the computer to turn off this device to save power<\/strong> is enabled it actually puts it to sleep, not <strong>turn off<\/strong>. The result is an inverse of what it says :-\/<\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2014\/05\/Allow-the-computer-to-turn-off-this-device-to-save-power.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;\" title=\"Allow the computer to turn off this device to save power\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2014\/05\/Allow-the-computer-to-turn-off-this-device-to-save-power_thumb.png\" alt=\"Allow the computer to turn off this device to save power\" width=\"354\" height=\"365\" border=\"0\" \/><\/a><\/p>\n<p>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.<\/p>\n<p>&nbsp;<\/p>\n<h1>PowerShell<\/h1>\n<p>So I wrote a PowerShell script that queries all available WiFi adapters and disables the <strong>Allow the computer to turn off the device to save power. <\/strong><\/p>\n<p><a href=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2014\/05\/DisablePowerSavingForWLAN.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; float: none; padding-top: 0px; padding-left: 0px; margin-left: auto; display: block; padding-right: 0px; margin-right: auto; border: 0px;\" title=\"DisablePowerSavingForWLAN\" src=\"https:\/\/ingmarverheij.com\/wp-content\/uploads\/2014\/05\/DisablePowerSavingForWLAN_thumb.png\" alt=\"DisablePowerSavingForWLAN\" width=\"354\" height=\"103\" border=\"0\" \/><\/a><\/p>\n<h4><\/h4>\n<h4>Usage<\/h4>\n<p>The script runs without arguments but requires elevated privileges, this is enforced by the script.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Update 26\/10\/2017<\/strong><\/p>\n<p>If you want to disable powersave for all adapters, change line #71 from<\/p>\n<pre>If (($objNICproperties.\"*ifType\" -eq 71) -and<\/pre>\n<p>into<\/p>\n<pre>If ((<i>$objNICproperties.\"*ifType\" -eq 6 -or $objNICproperties.\"*ifType\" -eq 71<\/i>) -and<\/pre>\n<p>With special thanks to <strong>Ward Sprewers<\/strong> for the tip!<\/p>\n<p>&nbsp;<\/p>\n<h4>Download<\/h4>\n<p>You can download the files here:\u00a0<a  data-e-disable-page-transition=\"true\" class=\"download-link\" title=\"Version 1.0\" href=\"https:\/\/ingmarverheij.com\/en\/download\/6848\/?tmstv=1775315206\" rel=\"nofollow\" id=\"download-link-6848\" data-redirect=\"false\" >\n\tDisablePowerSavingForWLAN<\/a>\n<\/p>\n<p>&nbsp;<\/p>\n<p>.<\/p>","protected":false},"excerpt":{"rendered":"<p>When a Windows computer enters sleep mode it ensures that WiFi adapters enters the device power state D3 (Sleep) and on resume ensure it puts it back to the device power state D0 (Full on). Windows assumes that if a driver says it supports sleep states it handles this correctly, but this setting is known [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"site-container-style":"default","site-container-layout":"default","site-sidebar-layout":"default","disable-article-header":"default","disable-site-header":"default","disable-site-footer":"default","disable-content-area-spacing":"default","footnotes":""},"categories":[288],"tags":[657,672,656],"class_list":["post-6845","post","type-post","status-publish","format-standard","hentry","category-other","tag-power-saving","tag-powershell","tag-wifi"],"_links":{"self":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/6845","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/comments?post=6845"}],"version-history":[{"count":6,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/6845\/revisions"}],"predecessor-version":[{"id":7027,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/posts\/6845\/revisions\/7027"}],"wp:attachment":[{"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/media?parent=6845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/categories?post=6845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ingmarverheij.com\/en\/wp-json\/wp\/v2\/tags?post=6845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}