Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PowerShell system configuration stuff

Status
Not open for further replies.

gbaughma

IS-IT--Management
Staff member
Nov 21, 2003
4,772
US
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
 
  • Thread starter
  • Moderator
  • #2
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
 
  • Thread starter
  • Moderator
  • #3
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top