PowerShell to set a powerplan active

Posted on 2012-09-05
Last Modified: 2012-09-05
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?"


Question by:Resonetics
    1 Comment

    Accepted Solution

    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

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Online collaboration can help businesses be more efficient, help employees grow their skills and foster a team environment.
    Not many admins are aware that GPOs can be activated and deactivated time-based. Time to change that :)
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now