Advertisement
mmannoni

power options

Sep 8th, 2018
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # This is a tiny little script which disables power management on every NIC (Wired/Wireless)
  2. # The script is searching for "PCI" (to only match "real" NICs, not virtual ones like e.g. the ISATAP Adapter...) in
  3. # HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
  4. # (which is the default location for NIC related settings) and adds the DWORD "PnPCapabilities" with the Value 56 (decimal) to disable the power management.
  5. #
  6. # Works on XP/Server 2003, Vista/Server 2008, Windows 7/Server 2008 R2, Windows 8/Server 2012/Server 2016 and Windows v.Next :-)
  7. # In order to run this script you might need to change the Powershell Script Execution Policy. Type "get-help about_signing" in a Powershell Window for more information.
  8. #
  9. # Version 1.0
  10. # USE TOTALLY AT YOUR OWN RISK!
  11.  
  12. $SearchString = "PCI"  
  13.  
  14. dir 'HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}' -rec -ea SilentlyContinue |    
  15.        ForEach-Object {    
  16.       if((get-itemproperty -Path $_.PsPath) -match $SearchString)  
  17.       {    
  18.         $_.PsPath
  19.     Set-ItemProperty -path $_.PsPath -Type DWord -Name PnPCapabilities -Value 56  
  20.       }    
  21.    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement