Change and Restore Power Plan during TS

Ok, so this is old news. You change your Power Plan to High Performance during your TS to speed up the process.  So maybe you did that for a software upgrade (office, or Win10 Build upgrade), and then your user complained that the power settings were different than how they had configured it.

How about you grab the current power plan, put that in a TS Variable for later, change your power plan to High Performance, then after all your work is done, set the Power Plan back to the original plan using that TS Variable… that sounds good right?

So what does this look like in the TS?  2 Groups, 5 steps (No content required)


  1. Group 1 - Power Settings Change (no conditions on Group)
    1. Set TS Var "PowerPlan" to WMI's Active PowerPlan
      Code: powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; $tsenv.Value('PowerPlan') = (Get-WmiObject -Class win32_powerplan -Namespace root\cimv2\power -Filter {isActive='true'} -EA silentlyContinue).elementname}"
    2. Record Current Plan in SMSTS log (This writes the Current plan into the log file.) – This step is Optional. I just like to have that info in the SMSTS log for troubleshooting.
      Code: powershell.exe -executionpolicy bypass -command "& {$tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment; $tsenv.Value('PowerPlan')}" –verbose
    3. Set Power Options - High Performance
      Condition: Task Sequence Variable PowerPlan not equals High performance
      imageCode: PowerCfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
  2. Group 2: Power Settings Restore (only runs if computer originally had something different than High Performance set)
    Conditions: Task Sequence Variable PowerPlan not equals High Performance

    1. Set Power Options - Balanced
      Conditions: Task Sequence Variable PowerPlan equals Balanced
      Code: PowerCfg.exe /s a1841308-3541-4fab-bc81-f71556f20b4a
    2. Set Power Options - Power saver
      Conditions: Task Sequence Variable PowerPlan equals Power saver
      Code: PowerCfg.exe /s a1841308-3541-4fab-bc81-f71556f20b4a

And that’s it.  Now, just like your parents always told you, put things back when you’re done.

To watch this in progress, check out this video.  Here I test starting on each of the 3 power plans, for Power saver & Balanced, you'll see it change to High performance, and back. When starting with High performance, it stays consistent for the entire TS.

Thanks to @PotentEngineer for the info to get me over the hump:

So whats up with GARYTOWN, where you been?

Hey Everyone, sorry I haven't had time to do any blogging lately.  I recently transitioned from my position at the State of MN, and started working at Wells Fargo, where I have the privilege of working with several amazing people on a daily basis, like Mike Terrill & Keith Garner.  There are several others there too that I have the privilege of working with occasionally, and to be honest, it's quite overwhelming the amount of talent Wells Fargo has on staff, and I feel honored to be in their ranks.

I no longer have access to the same plethora of equipment, and many of the solutions I've worked on at a smaller / medium business don't scale up well to the size of Wells Fargo.  I used to be under the mindset of getting out of the Management Business, let the vendor tools automatically do the work for you, give up control of the little things (BIOS updates, Drivers installs and updates, Windows updates, 3rd Party software auto updates, etc) to focus on the big things. (Windows as a Service, keeping environment updated, implementing new tech).  However in an environment like this, we need complete control at all times over every little detail.  As I try to change paradigms of workstation management, I'm unsure how that will effect my blog.  Not having access to the same resources as before I'm sure will impact my writing, as well as many of the things just aren't in my new job responsibilities, so I won't be working with them on a daily basis any longer.

As I find time between work, being the best husband I can be, parenting 5 children under the age of 9, being active in our local church community, and assisting with Home Schooling responsibilities at home and in our Co-Op, I'm planning to build out a lab at home, and hopefully get my hands on some Dell equipment. It's been a pleasure contributing to the community, and hopefully I'll be more active again soon, but for at least the immediate future, I hope you find my website valuable, and look forward to chatting on Twitter.


Gary Blok

New blog thanks to peer pressure

Just finished up a great MMS #mmsmoa conference today.  I was challenged to blog several solutions for Windows deployments, among other useful things I've come up with over the past few years.  So at their request, I've resurrected my old domain name and will now use it to blog about technology.

I've created this instance of WordPress and blog post from my phone, so I'm going to keep this short.

Look for several posts to come soon about Windows 10 deployments, among other OSD centered content.

Thanks to all the MVPs that made it to MN for MMS.