Reducing Windows Deployment time using Power Management

The following post was contributed by Benjamin Rampe a Senior PFE working for Microsoft.

While studying up on Windows 10, I came across a technique that has been shown to reduce the time it takes to apply an OS WIM to disk by 20 – 50%*.  That’s a fairly significant savings in time and the implementation of this technique is relatively easy and does not require you to change how you deploy Windows.  Believe it or not, the savings come from adjusting the OS power management settings during a deployment.  While there are multiple ways to implement these power management settings, below I’ve outlined what I consider the most non-intrusive to existing deployment methods. 

Steps:

1. Copy PowerCfg.exe binaries to MDT Files package’s Scripts subfolder

  • By default, WinPE runs with the power management scheme set to “Balanced”
  • ConfigMgr 2012 R2’s boot images use WinPE v5.0 which is based on the Windows 8.1 OS
  • PowerCfg.exe is necessary for changing the power management scheme
  • PowerCfg.exe is not included in WinPE
  • Create subfolders in the MDT Files package’s Scripts subfolder for each architecture, as shown below:

            

  • From a system running Windows 8.1 (or Server 2012 R2) copy %WINDIR%\System32\PowerCfg.exe to the AMD64 folder in the MDT Files package Scripts folder
  • From a system running Windows 8.1 (or Server 2012 R2) copy %WINDIR%\SysWOW64\PowerCfg.exe to the x86 folder in the MDT Files package Scripts folder
  • Update distribution points for the MDT Files package (Note: SysWOW64 contains 32 bit files hence we use this folder.)

2. Insert a step early in the task sequence to set the power management scheme to “High performance”

  • The GUID for the High performance scheme is “8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c”
  • The GUIDs for the default power management schemes in Windows are consistent between Windows versions (Vista and later)
  • The first instance of this action is for setting the power scheme during a REFRESH scenario (which starts in the full/old Windows OS).  In this scenario, we want to execute the PowerCfg.exe native binary included in the OS (not the version in the MDT Files package).  The Command line for this instance should be:  “PowerCfg.exe /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c”.  To ensure this action only runs during a REFRESH scenario, the condition on this step should be “_SMSTSInWinPE not equals TRUE”
  • The second instance of this action is for setting the power scheme during a NEW COMPUTER scenario (which starts in WinPE).  In this scenario, we want to execute the PowerCfg.exe binary included in the MDT Files package.  The Command line for this instance should be:  “"%DeployRoot%\Scripts\%PROCESSOR_ARCHITECTURE%\PowerCfg.exe" /s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c”.  To ensure this action only runs during a NEW COMPUTER scenario, the condition on this step should be “_SMSTSInWinPE equals TRUE”
  • The example below leverages the MDT-specific variable %DeployRoot% which gets instantiated only after a “Use Toolkit Package”, so be sure to insert the step to change the power scheme after the first “Use Toolkit Package” as shown below:

             clip_image003

3. After every “Restart Computer” step within the Preinstall, Install, and Post Installphases, insert another action to reset the power management scheme to “High performance” using the PowerCfg.exe from the MDT Files package.  These 3 phases all run under WinPE which does not persist the power scheme between reboots.  For example:

             clip_image005

4. After the first “Restart Computer” step within the State Restorephase, insert another action to reset the power management scheme to “High performance” using PowerCfg.exe from the native (full) Windows OS as shown below.  (NOTE:  Perhaps a better alternative to implementing this step would be to set the power scheme to High performance prior to image capture which would provide the added benefit of using the High performance scheme during PnP enumeration, driver installation, etc.):

            clip_image002

5. Finally, set the power management scheme to the scheme you wish for the system to use after the deployment.  In the example below, the GUID for the Balanced power scheme is set.  GUIDs for the built-in power schemes in Windows can be found here.  To set the GUID for any custom scheme, use “PowerCfg.exe –L” to obtain the scheme’s GUID and paste into the Command line for the action: 

            clip_image011

Early results are very promising using this technique, we would love to hear if this improved the speed of your deployment via the comments.

*From Windows 10 for PCs and 2 in 1s Manufacturing End-to-End Overview – https://channel9.msdn.com/Events/WinHEC/2015/WDI201

Disclaimer: The information on this site is provided "AS IS" with no warranties, confers no rights, and is not supported by the authors or Microsoft Corporation. Use of included script samples are subject to the terms specified in the Terms of Use .