This short blog will be about some new, long-awaited Intune Power Settings. I guess everyone knows this problem: How do you ensure your hard disk does not take a nap after some idle time?
I will show you how to configure a device’s power management settings using PowerShell and a Settings catalog.
1. Using PowerShell to configure the Power Settings
Until now, you didn’t have many options to ensure the device didn’t go to sleep. We only had two options.
The first Option to define the Power Options :
The first option you had was configuring these settings by using a PowerShell script (or converting the script to an exe and a win32app)
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg.exe -x -standby-timeout-ac 0
powercfg.exe -x -standby-timeout-dc 0
powercfg.exe -x -hibernate-timeout-ac 0
powercfg.exe -x -hibernate-timeout-dc 0
powercfg.exe -x -monitor-timeout-ac 0
powercfg.exe -x -monitor-timeout-dc 0
powercfg.exe -x -disk-timeout-ac 0
powercfg.exe -x -disk-timeout-dc 0
The corresponding explanation of each powercfg command above:
- Disable Connected Standby (Modern Standby)
powercfg -setdcvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg -setacvalueindex SCHEME_CURRENT 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
- Prevents system from entering Modern Standby (S0 low-power mode).
- Disable Standby (Sleep Mode)
powercfg.exe -x -standby-timeout-ac 0
powercfg.exe -x -standby-timeout-dc 0
- Prevents sleep mode when plugged in and on battery.
- Disable Hibernation Timeout
powercfg.exe -x -hibernate-timeout-ac 0
powercfg.exe -x -hibernate-timeout-dc 0
- Prevents system from entering hibernation.
- Prevent Display from Turning Off
powercfg.exe -x -monitor-timeout-ac 0
powercfg.exe -x -monitor-timeout-dc 0
- Keeps monitor always on.
- Prevent Hard Disk from Powering Down
powercfg.exe -x -disk-timeout-ac 0
powercfg.exe -x -disk-timeout-dc 0
- Prevents hard disk from entering power-saving mode.
The second Option is to define the Power Settings
Creating an Intunewinapp with these two files in it.
Content of the REG
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings]
"ActivePowerScheme"="8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettingsc0bc021-c8a8-4e07-a973-6b14cbcb2b7e]
"DCSettingIndex"=dword:00000000
"ACSettingIndex"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettingsCA83367-6E45-459F-A27B-476B1D01C936]
"DCSettingIndex"=dword:00000000
"ACSettingIndex"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings38E2C4-E8A5-4A42-B16A-E040E769756E]
"ACSettingIndex"=dword:00000000
"DCSettingIndex"=dword:00000000
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings48EFA3-DD9C-4E3E-B566-50F929386280]
"DCSettingIndex"=dword:00000003
"ACSettingIndex"=dword:00000003
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings996BC0-AD50-47EC-923B-6F41874DD9EB]
"DCSettingIndex"=dword:00000001
"ACSettingIndex"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Power\PowerSettings\A7066653-8D6C-40A8-910E-A1F54B84C7E5]
"ACSettingIndex"=dword:00000002
"DCSettingIndex"=dword:00000002
and the content of the PowerShell script
Start-Process -filepath "C:\windows\regedit.exe" -argumentlist "/s .\ADMX_POLICIES.reg"
gpupdate /force
New-Item -Path "c:\" -Name "temp" -ItemType "directory" -force
$path = "c:\temp"
New-Item -path $path -name "power.txt" -ItemType file -force
This script practically does the same thing as the PowerCFG command but with one big difference. The power settings are now defined as Policies, and we all know what we can’t do with policies being set. The user won’t be able to change any of the configured policies.
A good idea would be to add an uninstall script to ensure you can withdraw the configured settings. You don’t want them being tattooed. Luckily with config refresh, you can ensure those settings will be removed from the device once config refresh kicks in.
2. Using the Settings Catalog
Have you taken a look at the latest Settings Catalog? If you did, you would have spotted something beautiful. As shown below, we can now configure all the power management settings we want.
The moment you configure and deploy this policy, all of the corresponding policies will be visible in the policy manager registry key. If you open regedit and browse to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\PolicyManager\current\device\ADMX_Power
We can spot all the configured power management policies.
If you want to read all about this CSP, here is the link to the official Microsoft doc
Policy CSP – ADMX_Power – Windows Client Management | Microsoft Docs
The results
Now we have seen we can configure this setting with the new setting catalog, let us take a look at the results:
The hard disk power scheme settings:
The power scheme itself:
As shown below, after applying the policy, the power plan is now set to High performance. Just how I like it!
Conclusion:
I can’t wait until we can use these power settings in production. Using the Settings Catalog is way better than a Powershell script, but sometimes a PowerShell could still work better.
Great post, sir.
I was working on the Settings Catalog now out of preview, but still having some issues with setting Sleep mode on AC or Plugged-in doesn’t seem to work.
Any idea on this?
Best regards,
Bram
Hi, we are also using this settings, but we configured it to zero.. That’s working. Did you make sure the device has the latest update installed KB5005101? as it is a prereq for settings to function…
So I am testing this, and for some reasons whether its related to the article (Apologies in advance if not)
the Battery slider for mobile laptop devices always sits on the Battery saver mode even if its configured to do Performance mode, is there something else i am missing that may be other settings related?
Could you share the settings you configured so I could take a look at it ?
We are using 3 settings from the catalog
– Closing lid action
– Sleep timeout on battery
– Sleep timeout on AC
All 3 settings works but for some reason the sleep timeout is not greyed out on the user side and still showing 10 minutes. It actually never goes to sleep but I would like that setting to reflect reality on the user machine. Any ideas?
I have enabled it in my test tenant, lets see what happens… with the powershell options it was greyed out..
It’s seems to be available in the built-in administrative templates so I’m trying with that .. All with a timer of 0.
Specify the system sleep timeout (plugged in)
Specify the system hibernate timeout (on battery)
Specify the system sleep timeout (on battery)
Specify the system hibernate timeout (plugged in)
Hey Rudy,
We are currently deploying battery options using the settings catalog.
Some users prefer other setting than what we normally give them, so i want them to be able to change it themselves, but I also want the basis to be there so ‘normal’ users dont have to worry about it.
Currently the options to change the settings are greyed out on the laptop itself. Do you know how i can make it so the user can change their settings, while the laptop gets deployed with predetermined settings?
Thanks in advance.
What about “Power Mode” “plugged-in” vs “on battery” they added to Windows 11 at some point? Been doing this for 20 years and it boggles my mind that power configuration is still such a beating.