|T O P I C R E V I E W
||Posted - 04/27/2010 : 08:44:24 AM
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?
|16 L A T E S T R E P L I E S (Newest First)
||Posted - 05/16/2012 : 5:24:38 PM
Many thanks Johan. This will be a big help.
||Posted - 05/16/2012 : 5:16:51 PM
Thanks, i will take a look tomorrow... It's getting late here (I'm in europe this week)
||Posted - 05/16/2012 : 4:15:25 PM
By the way, I renamed the batch files ext. to .txt so it would pass gmail's filters.
||Posted - 05/16/2012 : 4:12:20 PM
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.
||Posted - 05/16/2012 : 3:30:38 PM
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...
||Posted - 05/16/2012 : 2:26:27 PM
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.
||Posted - 05/16/2012 : 2:17:11 PM
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).
||Posted - 05/16/2012 : 2:04:57 PM
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.
||Posted - 01/19/2011 : 09:18:02 AM
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.
||Posted - 01/18/2011 : 8:53:43 PM
Did you start the batch file with cmd /c <name-of-batch-file> in the MDT application?
||Posted - 01/18/2011 : 7:26:48 PM
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:
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...
||Posted - 05/11/2010 : 09:22:31 AM
Definitely helps. Thank you. If you could also provide examples of modifying an existing profile that would be great.
||Posted - 05/05/2010 : 12:01:54 PM
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.
||Posted - 04/28/2010 : 08:27:35 AM
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.
||Posted - 04/28/2010 : 08:25:13 AM
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
To see the details of yor current power profile, type
Does that help? If you like, I can provide examples of modifying an existing profile.
||Posted - 04/27/2010 : 08:52:04 AM
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.