Mark Minasi's Reader Forum
Mark Minasi's Reader Forum
Home | Profile | Register | Active Topics | Active Polls | Members | Search | FAQ | Minasi Forum RSS Feed
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 HALP! Questions on Windows and Windows Server
 Deployment: Windows and apps
 Configure/change power options via MDT 2010
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

zmobile
Seasoned But Casual Onlooker

37 Posts
Status: offline

Posted - 04/27/2010 :  08:44:24 AM  Show Profile  Reply with Quote
I would like to modify the Windows 7 power options via the MDT 2010 console; either by using the unattend or a task sequence. Can anyone explain the best way to change to the Power Options using the MDT 2010?

vandrd
Seasoned But Casual Onlooker

Canada
66 Posts
Status: offline

Posted - 04/27/2010 :  08:52:04 AM  Show Profile  Reply with Quote
By default Windows 7 has 3 Power Plans: Balanced, Power Saver, and High Perfomance.

You can customize your own power plans and then apply them by either adding them as an application, or adding a custom command in your task sequence.

Do a search in the WAIK User's Guide for "Configure Power Plan". This guide will show you how to create a custom power plan
and the command line switches you will need to apply it.

Dan Van Drunen
MCSE Specializing in Setup/Deployment


Edited by - vandrd on 04/27/2010 08:54:03 AM
Go to Top of Page

Mark Minasi
Chief cook and bottle washer

USA
10658 Posts
Status: offline

Posted - 04/28/2010 :  08:25:13 AM  Show Profile  Visit Mark Minasi's Homepage  Reply with Quote
Hi Z --

Remember that you can use a WSIM script (see my newsletter #60) to deploy or do some of your deploying. It, like the MDT itself, lets you add in command-line tools wherever you want. That's where "powercfg" comes in.

When you said "... modify the Windows 7 power options..." I wasn't sure whether you meant that you wanted to choose a prebuilt profile other than "Balanced," or if you wanted to take Balanced and tweak it somehow. Powercfg can do either.

If all you want to do is to select one of the three built-in power profiles, just insert this command:

powercfg -s <guid>, where

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)

So, for example, to set a system to the "High performance" profile, just type

powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

By the way, I listed those power profiles by typing

powercfg -L

To see the details of yor current power profile, type

powercfg -q

Does that help? If you like, I can provide examples of modifying an existing profile.

Mark
tweetin' at mminasi
Go to Top of Page

Mark Minasi
Chief cook and bottle washer

USA
10658 Posts
Status: offline

Posted - 04/28/2010 :  08:27:35 AM  Show Profile  Visit Mark Minasi's Homepage  Reply with Quote
Oh, oops, forgot... remember that if you're deploying Vista or later, you can control power settings via group policies -- perhaps the easiest approach.

And I hope you don't mind that I'm changing the title of this to "Controlling power settings in MDT" so it's easier for others to find.

Mark
tweetin' at mminasi
Go to Top of Page

peteostro
Seasoned But Casual Onlooker

59 Posts
Status: offline

Posted - 05/05/2010 :  12:01:54 PM  Show Profile  Visit peteostro's Homepage  Reply with Quote
I had issues with this, Windows 7 Does not allow you to change power settings with MDT do to permission issues. Any one seen this? I ended up making the power changes on our base wim.

Edited by - peteostro on 05/05/2010 12:02:57 PM
Go to Top of Page

zmobile
Seasoned But Casual Onlooker

37 Posts
Status: offline

Posted - 05/11/2010 :  09:22:31 AM  Show Profile  Reply with Quote
Mark,
Definitely helps. Thank you. If you could also provide examples of modifying an existing profile that would be great.
Go to Top of Page

frustrated
Welcome Newcomer

14 Posts
Status: offline

Posted - 01/18/2011 :  7:26:48 PM  Show Profile  Reply with Quote
I'm working on figuring out the VBScript for this, but currently I"m having issues copying over my custom power plan via batch file using Run Command Line in MDT 2010.

My batch file is:


@ECHO OFF
SET GUID=
Copy "%~dp0CSG Laptop.pow" C:\Windows
FOR /F "tokens=6" %%i in ('powercfg -import "C:\Windows\CSG Laptop.pow"') do SET GUID=%%i
powercfg -s %GUID%



This just produces errors and doesn't run when I call it using litetouch.vbs. I'm not sure what the limitations of running batch scripts through MDT 2010 are exactly, except that there are some issues with UNC paths and working directories (thanks arwidmark!).

I was testing another command that simply adds a value to the registry to disable UAC and have the same issue with it not executing. I assumed that there were permissions issues, and indeed there were when trying to execute from the AD account i have setup so I told MDT 2010 to run as the local admin (%computername%\administrator) and not to load the account. This still doesn't work for me unfortunately. I also tried inputting the computername instead of a variable, and loading the account to no avail.

This is frustrating, but I suppose it would be 100x easier using vbscript...

Edited by - frustrated on 01/18/2011 7:27:26 PM
Go to Top of Page

arwidmark
Old Timer

Sweden
530 Posts
Status: offline

Posted - 01/18/2011 :  8:53:43 PM  Show Profile  Visit arwidmark's Homepage  Reply with Quote
Did you start the batch file with cmd /c <name-of-batch-file> in the MDT application?

/ Johan

Regards

Johan Arwidmark
Microsoft MVP - Setup / Deployment
http://www.deploymentresearch.com
http://www.facebook.com/DeploymentResearch
Twitter: @jarwidmark
Go to Top of Page

frustrated
Welcome Newcomer

14 Posts
Status: offline

Posted - 01/19/2011 :  09:18:02 AM  Show Profile  Reply with Quote
Yes, but unfortunately this still doesn't work. I have some more testing to do with this still in batch form before I move on to translating it into vbscript.

On another note, I have managed to write a vbscript that configures the registry for a few applications, thanks to the script you wrote for me earlier. Using what little knowledge I have of the syntax of OOP, I was able to figure out some of the objects and semantics to write to the registry and modify files/folders on the computer. Still working on things like finding characters in strings, outputting to log files (though your script makes this a million times easier than starting from scratch).

As soon as I have something working (searching for GUID string and all), I will post it here so others may benefit.
Go to Top of Page

Sirtis
Welcome Newcomer

5 Posts
Status: offline

Posted - 05/16/2012 :  2:04:57 PM  Show Profile  Reply with Quote
I know this hasn't been replied to in a while, but I have the permissions error as well. I saw a couple replies with the same issue, but no on has addressed this.

Any idea?
Go to Top of Page

arwidmark
Old Timer

Sweden
530 Posts
Status: offline

Posted - 05/16/2012 :  2:17:11 PM  Show Profile  Visit arwidmark's Homepage  Reply with Quote
Last time I needed to do some Power Settings I just run the powercfg command directly as a command line action in the task sequence.

I used the following command: powercfg -Change -monitor-timeout-ac 120

Worked great, and I can't see why other powercfg commands wouldn't work (assuming they work if you run them manually).

/ Johan

Regards

Johan Arwidmark
Microsoft MVP - Setup / Deployment
http://www.deploymentresearch.com
http://www.facebook.com/DeploymentResearch
Twitter: @jarwidmark
Go to Top of Page

Sirtis
Welcome Newcomer

5 Posts
Status: offline

Posted - 05/16/2012 :  2:26:27 PM  Show Profile  Reply with Quote
I've got a batch file that works when I launch it manually, both normally, and under "run as administrator" while logged in as local admin.

If I add it as an "Run Command Line" step or App Intall step in MDT 2012, I used the command: cmd.exe c/ name_of_file.bat

I start it in "c:\IT\Scripts\Power\Laptop" which is where the bat file and the .pow file reside.

Or I add to the MDT scriptroot and try to start it there.

The batch file runs ok without error, but if I pit a pause in the bat file, I can see when attempting to import the .pow. it says I don't have permission.
Go to Top of Page

arwidmark
Old Timer

Sweden
530 Posts
Status: offline

Posted - 05/16/2012 :  3:30:38 PM  Show Profile  Visit arwidmark's Homepage  Reply with Quote
I try to avoid batch files as much as I can due to their limitations, If you zip together your bat file and pow file, and email it to me, I can convert it to a working vbscript for you.

The only "requirement" would be that you allow me to post the script publicly so that other people can take advantage of it. My email alias is my last name, and I'm using gmail...

/ Johan

Regards

Johan Arwidmark
Microsoft MVP - Setup / Deployment
http://www.deploymentresearch.com
http://www.facebook.com/DeploymentResearch
Twitter: @jarwidmark
Go to Top of Page

Sirtis
Welcome Newcomer

5 Posts
Status: offline

Posted - 05/16/2012 :  4:12:20 PM  Show Profile  Reply with Quote
I appreciate that Johan.

On the way.

I've attached Power.zip. It includes two sets of files, One for a desktop power plan and one for a laptop power plan.

The bat file is written so that it checks to see if the plan is installed first. If so, it activates it. If not, it imports and activates it.
Go to Top of Page

Sirtis
Welcome Newcomer

5 Posts
Status: offline

Posted - 05/16/2012 :  4:15:25 PM  Show Profile  Reply with Quote
By the way, I renamed the batch files ext. to .txt so it would pass gmail's filters.
Go to Top of Page

arwidmark
Old Timer

Sweden
530 Posts
Status: offline

Posted - 05/16/2012 :  5:16:51 PM  Show Profile  Visit arwidmark's Homepage  Reply with Quote
Thanks, i will take a look tomorrow... It's getting late here (I'm in europe this week)

/ Johan

Regards

Johan Arwidmark
Microsoft MVP - Setup / Deployment
http://www.deploymentresearch.com
http://www.facebook.com/DeploymentResearch
Twitter: @jarwidmark
Go to Top of Page

Sirtis
Welcome Newcomer

5 Posts
Status: offline

Posted - 05/16/2012 :  5:24:38 PM  Show Profile  Reply with Quote
Many thanks Johan. This will be a big help.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Mark Minasi's Reader Forum © 2002-2011 Mark Minasi Go To Top Of Page
This page was generated in 0.17 seconds. Snitz Forums 2000