Windows
View all Worklets
WindowsWindows

Change Power Scheme

Enforce the active Windows power profile across endpoints using Win32_PowerPlan and powercfg automation

Worklet Details

What the power profile enforcer does

This Automox Worklet™ enforces the active Windows power profile on each endpoint. The Worklet queries the Win32_PowerPlan CIM class under the root\cimv2\power namespace, confirms that the requested profile exists, and activates it with powercfg.exe when it is present but not currently in use. The evaluation phase is idempotent, so endpoints that already match the policy report as compliant without touching configuration.

Windows ships three built-in power profiles. Power Saver reduces CPU performance and shortens display and disk timeouts to stretch battery life. Balanced scales performance against demand on the fly. High Performance pins the CPU at higher frequencies and disables aggressive power-saving behavior. OEM laptops and workstations often ship additional profiles, and administrators can author custom ones with powercfg /create. The Worklet handles any profile name the endpoint exposes, not only the three built-ins.

Profile names are case-sensitive. If the value of $pwrProfile does not match an ElementName on the endpoint, the script lists every available profile in its output. An admin can then correct the policy without having to RDP to the endpoint. The remediation script returns exit code 2 on any failure path. Failures surface as a failed activity in Automox rather than silent drift.

Why enforce power profiles fleet-wide

The active power profile decides how every Windows endpoint trades CPU performance against energy and battery life. A finance laptop accidentally left on High Performance burns through battery on the road. A trading workstation on Balanced throttles during market open and clips a real-time pipeline. A field engineer on Power Saver sees the IDE stall for seconds at a time. Users rarely touch the Control Panel applet. Whatever was active at first boot is usually still active years later, regardless of how the endpoint is actually used.

Power-profile GUIDs flip whenever a user clicks the battery icon, an OEM utility installs its own power plan, or a feature update resets the active scheme to Balanced. Schedule this Worklet against the workstation, laptop, or server endpoint group that needs a specific power posture so powercfg /setactive lands against the documented GUID on first pass. A weekly evaluation reasserts the High Performance, Balanced, or Power Saver profile the platform team approved across re-imaged endpoints, dock changes, and OEM tooling that rewrites the active scheme.

How power profile enforcement works

  1. Evaluation phase: The script runs Get-CimInstance -Namespace root\cimv2\power -ClassName Win32_PowerPlan -Filter "ElementName='$pwrProfile'" to locate the requested profile. If the result is null, the script enumerates every Win32_PowerPlan instance, prints the available ElementName values, and exits 2. If the profile exists and its IsActive property is true, the endpoint exits 0 as compliant. If the profile exists but IsActive is false, the endpoint is flagged for remediation.

  2. Remediation phase: The script extracts the GUID segment from InstanceID and strips the surrounding braces. It then runs powercfg.exe /s <GUID> through Start-Process so the exit code can be captured. After a two-second sleep to let Windows commit the change, the script re-queries Win32_PowerPlan and confirms IsActive on the requested profile. On confirmation, the script writes SUCCESS to output and exits 0. The script exits 2 when powercfg returns a non-zero code, when the GUID cannot be extracted, or when the post-change validation fails.

Power profile enforcement requirements

  • Windows 7 or later, including Windows 10, Windows 11, Windows Server 2012 R2 and above

  • PowerShell 2.0 or later with access to the root\cimv2\power WMI namespace

  • Local administrator context for powercfg.exe /s, which the Automox agent already provides

  • Set $pwrProfile in both evaluation.ps1 and remediation.ps1 to the exact ElementName of the target profile (case-sensitive)

  • Built-in values: Power Saver, Balanced, High Performance. Run powercfg /list on a reference endpoint to confirm OEM or custom names before rollout

  • FixNow compatible, so an admin can target a single endpoint or a small group from the Automox console without waiting on the next policy run

Expected state after power profile enforcement

After successful remediation, the requested profile is active immediately and persists across reboots until another tool or user changes it. Power Saver reduces processor maximum frequency, dims displays sooner, and spins down hard disks more aggressively. Balanced returns the CPU and disk timers to demand-driven scaling. High Performance disables CPU throttling and prevents drives and displays from sleeping during short idle periods. Custom profiles apply whichever processor, sleep, display, and USB selective-suspend values the profile defines.

Validate on a pilot endpoint by running powercfg /getactivescheme from an elevated PowerShell session. The output shows the GUID and friendly name of the active scheme and should match the value the Worklet set. For a quick CIM check, run Get-CimInstance -Namespace root\cimv2\power -ClassName Win32_PowerPlan | Where-Object IsActive and confirm a single row is returned with the expected ElementName. Capture the output alongside the Automox policy run identifier for audit evidence.

Users with local rights can still flip the active profile through Settings or the Control Panel applet unless Group Policy restricts it. The next scheduled evaluation catches the drift and the remediation phase restores the baseline. The Worklet is safe to leave running on a recurring policy. For environments that need a hard lock, pair this Worklet with the Group Policy setting at Computer Configuration > Administrative Templates > System > Power Management > Specify a custom active power plan. That setting prevents the user-mode flip in the first place.

View in app
evalutation image
remediation image

Consider Worklets your easy button

What's a Worklet?

A Worklet is an automation script, written in Bash or PowerShell, designed for seamless execution on endpoints – at scale – within the Automox platform. Worklets deploy named-CVE mitigations within hours of disclosure, perform configuration, remediation, and install or remove applications and settings across Windows, macOS, and Linux.

do more with worklets