• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 764
  • Last Modified:

PowerShell to set a powerplan active

I am in the process of writing a script to configure a number of settings on Conference Room PC's.

Using powercfg.exe I am able to import the correct power scheme.

The problem I am having it with actually setting it.  The GUID is differemt each time you import it.  

This is what i have so far:

#Import and Set Power Settings
powercfg -import c:\cr\crsch.pow
Start-Sleep -s 15
powercfg -setactive e158c791-357b-43cf-bebf-64cc68aceb1a

Is there a way to setactive by "friendly name?"


1 Solution
ResoneticsAuthor Commented:
I figured this out and took a different approach:

Get-WmiObject -Class Win32_PowerPlan -Namespace root\cimv2\power -Filter "ElementName='Balanced'" | Invoke-WmiMethod -Name Activate

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now