Skip to content

Customising Windows 7 deployments - part 3.

Featured Replies

Imagine the scenario, you deploy some Windows 7 laptops but receive feedback from the users that they don't like the power management default settings,

to get around this you could use Group Policy or if that's not possible due to time constraints or other issues, you could import the power management settings directly into your image based on whether the target pc is a Laptop or Desktop.

 

The default power management plans in Windows 7 are pretty good, but also quite aggressive, so you will probably want to configure them in some way,

 

View current PowerScheme

 

First of all you will need to understand how to 'see' them. On a Client Laptop (not a VM or desktop, as they won't show the profiles we are interested in) open a administrator command prompt and type powercfg -list

 

 

 

C:\Users\windowsnoob\Desktop\LocalGPO>powercfg -list

 

Existing Power Schemes (* Active)

-----------------------------------

Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *

Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)

Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

 

from the above we can see the the Balanced power plan is selected currently.

 

 

 

Export current PowerScheme

 

 

Now let's make some changes to our Power scheme (as a test, change the values for hard disc time out in advanced properties of the current plan).

 

change power.JPG

 

Once you have power management the way you want, we will export our settings using powercfg -export

 

C:\Windows\system32>POWERCFG -EXPORT c:\scheme.pow b20406da-dd0d-432e-859b-399e994c7aff

 

 

 

Import a previously exported PowerScheme

 

 

Now that we have our pow settings saved, let's import them (on another computer) using powercfg -import

 

C:\Windows\system32>POWERCFG -IMPORT c:\scheme.pow

Imported Power Scheme Successfully. GUID: b20406da-dd0d-432e-859b-399e994c7aff

 

and verify

 

C:\Windows\system32>powercfg -list

 

Existing Power Schemes (* Active)

-----------------------------------

Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) *

Power Scheme GUID: 7d67c408-0a5b-4bfe-a2e8-19bcb22cf21e (Balanced)

Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)

Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

Power Scheme GUID: cba55b22-5cdc-4a45-b095-225d34a60e99 (Balanced)

Power Scheme GUID: b20406da-dd0d-432e-859b-399e994c7aff (Balanced)

 

Note that even though the scheme is imported, it's not set as default, to do that we have to use the powercfg -set command.

 

 

Set current PowerScheme

 

Ok now that we know how to import it, let's set a powerscheme, to do so use powercfg -setactive guid

 

 

C:\Users\windowsnoob\Desktop\LocalGPO>powercfg -setactive b20406da-dd0d-432e-859b-399e994c7aff

 

let's verify the change

 

C:\Users\windowsnoob\Desktop\LocalGPO>powercfg -list

 

Existing Power Schemes (* Active)

-----------------------------------

Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)

Power Scheme GUID: b20406da-dd0d-432e-859b-399e994c7aff (Balanced) *

Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)

Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

 

It Worked and now our powerscheme is set to our custom scheme.

  • 2 months later...
  • Author

now that we know how to change PowerScheme's we can apply the same logic in a Task Sequence, we use an MDT integrated task sequence to avail of some scripts within MDT.

 

Our first step is to use MDT's Gather function (MDT Settings) to determine if the computer is a laptop or desktop

 

gather.JPG

 

our second step use's the MDT Toolkit Package (MDT Files) as we have copied the powermanagement POW file(s) to a subfolder of the scripts directory called Power

 

use toolkit package.JPG

 

Our next step copies the files to our target folder (c:\windows) using this command line

xcopy.exe "%deployroot%\scripts\power\*" "c:\Windows" /Q /F /R /Y

 

copy powerscheme.JPG

 

Now we Import the power scheme using the powercfg -IMPORT command

 

import power scheme.JPG

 

and now we actually apply the power scheme based on whether the client machine is a laptop or desktop, first step is for a laptop

 

set power scheme laptop.JPG

 

and the query to check if it's a laptop is done on the options tab, the step will only run if the variable IsLaptop is True

 

isLaptop.JPG

 

and finally we have the Desktop Step

 

set desktop.JPG

 

and it's options are as follows

 

islaptop false.JPG

 

that's it, add the group above to a standard Windows 7 Deploy task sequence after the apply operating system step, deploy some Windows 7 laptops and desktops and note the newly changed Power Schemes !

  • 1 year later...

no matter where I put these steps I could not get this to work. I am able to manually apply the power schemes via command line within windows so I know my .pow file and guid are correct. It kept telling me that it couldn't find the pow file in the windows directory. I confirmed that it was there, but it would still fail.

I'm sure it is an issue with my step but I can't seem to find the smsts.log file after the machine has booted. I thought it was supposed to be c:\windows\syswow64\ccm\logs\smsts.log ???

  • Author

depends on whether you are in windows pe or not, did you check if there was a SMSTSLOG subdir in ccm\logs ? at what point are you trying to get the log ? during the ts, or after it's failed

yes, I'm trying to get it after it has failed (continue on failure checked). So it's in Full windows OS. There isn't a SMSTSLOG subdirectory in the ccm\logs folder. I'm confused and will just end up re-running the task sequence to grab the log I guess.

 

Hey on a side note - I'm trying to populate pc description in Ad with the model and serial number of the machine during deployment. I grabbed something from Maik Koster that was built for MDT but I thought I read it would work on SCCM. Is there anything wrong with using "oEnvironment" in SCCM task sequences?

Hmm.. I still can't seem to find the smstslog after windows has been deployed. I'm definetely missing something.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.