Example: biology

Script to disable 'turn off this device to save power' for ...

GO Software Pty LimitedMap: 27 Tacoma Blvd, Pasadena SA 5042 Phn: 0403-063-991 Fax: noneABN: 54-008-044-906 ACN: 008-044-906 Eml: to disable " turn off this device to save power" for NIC Power Management (PowerShell)IntroductionThis PowerShell Script illustrates how to disable " turn off this device to save power" feature in Power Management. this should ALWAYS be turned off on ALL servers as otherwise computer will periodicallylose connection to that server. It should also be turned off on all workstations as we have found that, often, if it's not turned off the computer will run "like a dog" and once it has been turned off and thecomputer rebooted then it runs like a new PC again. We have found that this setting is almost always TURNED ON by default (why?)

# without limitation, damages for loss of business profits, business interruption, # loss of business information, or other pecuniary loss) arising out of the use

Tags:

  Devices, Script, This, Turn, Disable, Script to disable turn off this device

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of Script to disable 'turn off this device to save power' for ...

1 GO Software Pty LimitedMap: 27 Tacoma Blvd, Pasadena SA 5042 Phn: 0403-063-991 Fax: noneABN: 54-008-044-906 ACN: 008-044-906 Eml: to disable " turn off this device to save power" for NIC Power Management (PowerShell)IntroductionThis PowerShell Script illustrates how to disable " turn off this device to save power" feature in Power Management. this should ALWAYS be turned off on ALL servers as otherwise computer will periodicallylose connection to that server. It should also be turned off on all workstations as we have found that, often, if it's not turned off the computer will run "like a dog" and once it has been turned off and thecomputer rebooted then it runs like a new PC again. We have found that this setting is almost always TURNED ON by default (why?)

2 ???) and sometimes the computer works fine for months or even years andthen one day it will suddenly start going VERRRRRY users want to disable the option in network device called: The computer turn off this device to save power. Now, this Script can help users to disable " turn off this device to save power" feature in PowerManagement of ALL physical network Click Start2. type powershell in the search box on the Start Menu3. right-click the Windows PowerShell icon4. then click Run as Administrator.(If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue).5. Run the Script in the Windows PowerShell Console6. To allow scripts to be run on Windows 8 you might need to type set-executionpolicy remotesigned7.

3 Type the command: { Script Path} at the example, type g:\support\ is shown in the following Finally, when the Script finishes running, it will return a brief message in the current Windows PowerShell Console and you will see this option has been disabled as can run a Script using a direct command like -noprofile -executionpolicy bypass -file .\ PowerShell forum # ---------------------------------------- ---------------------------------------- --------------- # - powershell Script to turn off power saving feature for all NICs# ---------------------------------------- ---------------------------------------- --------------- # The sample scripts are not supported under any Microsoft standard support program or service.

4 # The sample scripts are provided AS IS without warranty of any kind.# Microsoft further disclaims all implied warranties including, without limitation, # any implied warranties of merchantability or of fitness for a particular purpose.# The entire risk arising out of the use or performance of the sample scripts# and documentation remains with you.# In no event shall Microsoft, its authors, or anyone else involved in the creation, # production, or delivery of the scripts be liable for any damages whatsoever (including, # without limitation, damages for loss of business profits, business interruption, # without limitation, damages for loss of business profits, business interruption, # loss of business information, or other pecuniary loss)

5 Arising out of the use # of or inability to use the sample scripts or documentation, # even if Microsoft has been advised of the possibility of such damages # ---------------------------------------- ---------------------------------------- ---------------# requires - Powershell Version disable -OSCNetAdapterPnPCaptitlies{ # Find only physical network, if value of properties of adaptersConfigManagerErrorCode is 0, # it means device is working properly and even covers enabled or disconnected devices . # If the value of properties of configManagerErrorCode is 22, it means the adapter was disabled. $PhysicalAdapters=Get-WmiObject -Class Win32_NetworkAdapter|Where-Object{$ -notlike "ROOT\*" ` -and $ -ne "Microsoft" -and $ -eq 0 -and $ -ne 22} Foreach($PhysicalAdapter in $PhysicalAdapters) { $PhysicalAdapterName=$ # check the unique device id number of network adapter in the currently environment.}}

6 $DeviceID=$ If([Int32]$DeviceID -lt 10) { $AdapterDeviceNumber="000"+$DeviceID } Else { $AdapterDeviceNumber="00"+$DeviceID } # check whether the registry path exists. $KeyPath="HKLM:\SYSTEM\CurrentControlSet \Control\Class\{4D36E972-E325-11CE-BFC1- 08002bE10318}\$AdapterDeviceNumber" If(Test-Path -Path $KeyPath) { $PnPCapabilitiesValue=(Get-ItemProperty -Path $KeyPath).PnPCapabilities If($PnPCapabilitiesValue -eq 24) { Write-Warning "'$PhysicalAdapterName' - The option 'Allow the computer to turn off this device to save power' has been disabled already." } If($PnPCapabilitiesValue -eq 0) { # check whether change value was successed. Try { # setting the value of properties of PnPCapabilites to 24, it will disable save power option.}}}

7 Set-ItemProperty -Path $KeyPath -Name "PnPCapabilities" -Value 24 | Out-Null Write-Host "'$PhysicalAdapterName' - The option 'Allow the computer to turn off this device to save power' was disabled." Write-Warning "It will take effect after reboot, do you want to reboot right now?" [string]$Reboot=Read-Host -Prompt "[Y] Yes [N] No (default is 'N')" If ($Reboot -eq "y" -or $Reboot -eq "yes") { Restart-Computer -Force } } Catch { Write-Host "Setting the value of properties of PnpCapabilities failed." -ForegroundColor Red } } If($PnPCapabilitiesValue -eq $null) { Try { New-ItemProperty -Path $KeyPath -Name "PnPCapabilities" -Value 24 -PropertyType DWord | Out-Null Write-Host "'$PhysicalAdapterName' - The option 'Allow the computer to turn off this device to save power' was disabled.

8 " Write-Warning "It will take effect after reboot, do you want to reboot right now?" [string]$Reboot=Read-Host -Prompt "[Y] Yes [N] No (default is 'N')" If ($Reboot -eq "y" -or $Reboot -eq "yes") { Restart-Computer -Force } } Catch { Write-Host "Setting the value of properties of PnpCapabilities failed." -ForegroundColor Red } } } Else { Write-Warning "The path ($KeyPath) not found." } }} disable -OSCNetAdapterPnPCaptitlies Copyright 2014 by GO Software Pty Limit


Related search queries