Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

As of right now, optional programs during deployment include Microsoft Office 2013, Microsoft Visio 2013 and the Adobe Creative Suite, all of which are fairly sizable installs (especially the creative suite).. I want these programs to be installed as part of the image since they're so significant in size and install time, however if I check all 3, the machine ends up going to sleep mid-install and as such, ends up stuck.

 

Any way to prevent this? The machine is already part of the domain at this stage, so I could look into GPO/GPP, but I wouldn't want the machines to not go to sleep in-general, only during deployment. I want them to have power saving as normal once they're fully imaged/configured.

 

Anyone got a method for this?

Posted

I've just noticed this as well when we select CS6 to install as part of a MDT Task Sequence. Still looking into it, but I guess the best way would be to have a power plan set on the base image, as I guess it can't be a GPO as the machine is not on the domain at that point. Or, a powershell script in the Task Sequence to create and set a power plan. Any Powershell scripters want to offer a tip here?

 

Pete

Posted

Looking into this also, each power plan has a unique GUID, so I guess the script would need to extract the GUID for the High Performance Plan and set this with Powercfg.exe.

 

Please share if you get it done! ;)

 

Pete

Posted (edited)

The following does not work.

I've left my method-so-far here as reference, I'll keep working on it to see if I can find a way.

 

Firstly, fire up a Windows 10 machine, go to Settings, System, Power & Sleep, Additional Power Settings, Create a power plan, and give your new power plan a name (I chose "MDT Deployment Power Plan") - set your default plan to 'High Performance'.

Launch PowerShell and run the command powercfg -getactivescheme to ensure you have your new power plan selected. If not, switch to it with powercfg -list to get the GUID, and -powercfg -setactivescheme GUID.

 

Next, run the following commands.

powercfg -setdcvalueindex SCHEME_CURRENT SUB_NONE CONSOLELOCK 0

powercfg -setacvalueindex SCHEME_CURRENT SUB_NONE CONSOLELOCK 0

powercfg -setdcvalueindex SCHEME_CURRENT SUB_DISK DISKIDLE 0

powercfg -setacvalueindex SCHEME_CURRENT SUB_DISK DISKIDLE 0

powercfg -setdcvalueindex SCHEME_CURRENT SUB_SLEEP STANDBYIDLE 0

powercfg -setacvalueindex SCHEME_CURRENT SUB_SLEEP STANDBYIDLE 0

powercfg -setdcvalueindex SCHEME_CURRENT SUB_SLEEP HYBRIDSLEEP 0

powercfg -setacvalueindex SCHEME_CURRENT SUB_SLEEP HYBRIDSLEEP 0

powercfg -setdcvalueindex SCHEME_CURRENT SUB_SLEEP HIBERNATEIDLE 0

powercfg -setacvalueindex SCHEME_CURRENT SUB_SLEEP HIBERNATEIDLE 0

powercfg -setdcvalueindex SCHEME_CURRENT SUB_BUTTONS LIDACTION 0

powercfg -setacvalueindex SCHEME_CURRENT SUB_BUTTONS LIDACTION 0

powercfg -setdcvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 0

powercfg -setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 0

 

(Take note of set AC value and set DC value. I presume these matter depending on what part of the world you're in and what power grid you use)

 

Once these are set, run powercfg -export C:\MDTPowerScheme.pow GUID, find the power file, and stick it in your MDT Deployment Share (so it can be accessed by a computer during imaging, through the mapped Z:\ drive)

 

Log on to your MDT server, right-click on the deployment sequence, and select Properties. Click the Task Sequence tab.

Add 2 script tasks before 'Install Applications' (Add, General, Run PowerShell Script) Give them sensible names (such as Import MDT power settings and Apply MDT power settings)

In the first 'Powershell Script' box, enter powercfg -import Z:\.....\MDTPowerScheme.pow (ensuring that your path is correct)

In the second, enter powercfg -setactive GUID

Create 2 more script task in the deployment sequence, after 'Install Applications'. Give it a sensible name (Return to default power settings)

In the 'Powershell Script' box, enter powercfg -setactives 381b4222-f694-41f0-9685-ff5bb260df2e (ensuring that your path is correct)

In the second, it's powercfg -delete GUID

Edited by Garacesh
  • Thanks 1
Posted
Bummer, that doesn't work. The GUID doesn't stay the stay across export/import.

Try using the following PowerShell script to set the power plan to High Performance.

 

(Get-WMiObject -NameSpace root\cimv2\power -Class win32_PowerPlan -Filter "ElementName ='High Performance'").Activate()

 

This should prevent the computer going to sleep and also decrease the amount of time it takes to deploy your image and apps. As the third comment from the bottom mentions, you will need to add this to multiple locations in your MDT task sequence.

  • Thanks 1
Posted (edited)
(Get-WMiObject -NameSpace root\cimv2\power -Class win32_PowerPlan -Filter "ElementName ='High Performance'").Activate()

 

That seems like a bit long-winded.. Would powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c not do the job? (with a return to 381b4222-f694-41f0-9685-ff5bb260df2e command at the end). The GUID's for Balanced, High Performance and Power Saver are constant.

Edited by Garacesh
Posted
That seems like a bit long-winded.

Yeah. You could use powercfg if you only wanted to prevent the computer from going to sleep and weren't bothered about reducing the amount of time it took to deploy the image. :)

Posted

Based on Arthur's suggestion:

 

I copied PowerCfg.exe to my Script directory of my deployment share

Added an extra step (Run Command Line) before Applications get installed with 'PowerCfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c'

 

Machine is rebuilding at the moment and is showing as running in 'High Performance' so this should solve the problem.

 

I have various GPOs in place based on times and user groups to set various other power plans when the machine is finished and on the domain proper.

 

MDTPowerPlan.JPG

 

Pete

Posted
Based on Arthur's suggestion:

 

I copied PowerCfg.exe to my Script directory of my deployment share

Added an extra step (Run Command Line) before Applications get installed with 'PowerCfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c'

 

I'm doing similar, only with Run Command Line, powershell.exe "powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c"

Didn't realise powercfg was its own program, I'll have to change it to powercfg.exe for good measure.

 

I've set my deployment to install Office(+Visio), the Adobe suite and our CAD software, which are all reasonable installs. Let's see what happens.

Posted (edited)

Bah, mine still did it.. Looks like it's not going to sleep, but timing out the screen and locking the workstation :doh:

 

Edit to clarify: The power settings do toggle between high performance and balanced as part of the deployment sequence, it just doesn't stop the machine locking.

Edited by Garacesh
Posted
We use some scripts from Maik Koster (MDT Scripts, Front Ends, Web Services, and Utilities for use with ConfigMgr/SCCM - Documentation) to move the machine being built into an OU with GPOs blocked as an early stage of the build process. At the end another script moves the machine back to the final OU. This has solved all of the GPO problems such as sleeps, updates stopping installations for happening, unexpecetd restarts and so on.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...