# configure an "always-on" power profile for laptops and desktops
# Set display sleep to 30 minutes when on AC
Write-Host "Setting display sleep to 30 minutes when on AC..."
c:\windows\system32\powercfg.exe -change -monitor-timeout-ac 30
# Set display sleep to 10 minutes when on battery
Write-Host "Setting display sleep to 10 minutes when on battery..."
c:\windows\system32\powercfg.exe -change -monitor-timeout-dc 10
# Set hard drive sleep to 60 minutes when on AC
Write-Host "Setting hard drive sleep to 60 minutes when on AC..."
c:\windows\system32\powercfg.exe -change -disk-timeout-ac 60
# Set hard drive sleep to 30 minutes when on battery
Write-Host "Setting hard drive sleep to 30 minutes when on battery..."
c:\windows\system32\powercfg.exe -change -disk-timeout-dc 30
# Set Sleep to never when on AC
Write-Host "Setting Sleep to never when on AC..."
c:\windows\system32\powercfg.exe -change -standby-timeout-ac 0
# Set Sleep to 20 minutes when on battery
Write-Host "Setting Sleep to 20 minutes when on battery..."
c:\windows\system32\powercfg.exe -change -standby-timeout-dc 20
# Disable Hibernation if the workstation does not have a battery
$battery = Get-WmiObject win32_battery
if ($null -eq $battery) {
Write-Host "This workstation does not have a battery, disabling hibernation..."
c:\windows\system32\powercfg.exe -h off
} else {
# Set Hibernation to never when on AC
Write-Host "Setting Hibernation to never when on AC..."
c:\windows\system32\powercfg.exe -change -hibernate-timeout-ac 0
# Set Hibernation to 45 minutes when on battery
Write-Host "Setting Hibernation to 45 minutes when on battery..."
c:\windows\system32\powercfg.exe -change -hibernate-timeout-dc 45
}
Script data
Language - PowerShell
Run as - System / Root User
Script timeout duration - 5 Mins