INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

PowerShell system configuration stuff

PowerShell system configuration stuff

(OP)
I'm writing a powershell script to set various things on workstations that we are deploying.

One of the things that I need to set is the Power Plan.
I've been googling quite a bit, but can't find exactly what I'm looking for. Here's what I need to do.

1) Make a new powerplan called "MyCompany Power", using the High Performance plan as a template.
2) Make that new plan active.
3) Make some adjustments to that new plan (like not turning off the hard drive after 20 mins)

These may be desktops or laptops, so I need to set both "AC" and "Battery" settings.

Sorry to ask what should be a pretty simple question, but I figured I'd ask the experts here. :)

Thank you in advance!

Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg

RE: PowerShell system configuration stuff

(OP)
Mmm... I'm figuring it out.... here's what I have so far....

CODE

$HighPerf = powercfg -l | %{if($_.contains("High performance")) {$_.split()[3]}}
$NewScheme = powercfg -DUPLICATESCHEME SCHEME_MIN
$s = $NewScheme.Split()
$NewGUID = $s[3] 
powercfg -CHANGENAME $NewGUID "MyCompany Power"
powercfg -SETACTIVE $NewGUID 
... but now I have to figure out how to change a couple of very specific "Advance" power settings. Like Processor Power Management --> Minimum Processor State --> On Battery (and plugged in)

Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg

RE: PowerShell system configuration stuff

(OP)
I got it all working. Knowing that the GUID's didn't change helped. :D

Just my 2¢

"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."

--Greg

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close