Jump to content


  • 0
anyweb

Customising Windows 7 deployments - part 3.

Question

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.

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

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 !

Share this post


Link to post
Share on other sites

  • 0

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.

Share this post


Link to post
Share on other sites

  • 0

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

Share this post


Link to post
Share on other sites

  • 0

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?

Share this post


Link to post
Share on other sites

  • 0

i did, still no luck. I have mucked around with the task sequence so much that I just decided to create a clean "config testing" TS. I have done nothing more than open an HTA, apply an image, windows settings, config mgr client, and apply the power settings.

 

I will see what luck I have then. Hopefully even if it doesn't work, I will be able to find the smstslog.

 

I will update.

Share this post


Link to post
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.