Controlling the Power Settings in Local User Accounts
Novell Cool Solutions: Tip
By Ryan Kelly
Digg This -
Posted: 21 Jun 2006
PROBLEM: Many of my customers use DLU (Dynamic Local User) to create local user accounts on Windows 2K and XP machines. The problem is, if you do not have the "Default User" profile exactly the way you want it before you push an image out to many machines, it could cause annoyances in the future. One of these annoyances I've come across is the Power Settings for users. If these aren't set the way you want them (such as going into stand-by mode in 15 minutes) in the Default User profile, then every user that gets created on the system will receive these settings.
SOLUTION: To resolve this I created a simple application that will call the POWERCFG.EXE command-line tool built into Windows. In the application properties under Distribution Options > Distribution Scripts > Run Before Distribution, I entered the POWERCFG options. In this case I wanted to have everything set to Never. To do this the commands are as follows:
POWERCFG /SETACTIVE "Always On"
POWERCFG /CHANGE "Always On" /MONITOR-TIMEOUT-AC 0
POWERCFG /CHANGE "Always On" /DISK-TIMEOUT-AC 0
POWERCFG /CHANGE "Always On" /STANDBY-TIMEOUT-AC 0
NOTE: To see all of the POWERCFG options enter POWSERCFG /? in a command window. The 0 option sets the specified section to Never.
Put all of these lines in the script section and set the Script Engine Location as C:\windows\system32\cmd.exe /C (remember to put the /C at the end of the script engine exe.) For the Extension for the script file enter .BAT.
I set the Run Options > Environment > Executable security Level as "Run as Unsecure system User". For the other options, I uncheck "Show Progress" and check "Distribute always". I set the Associations option to "Force Run."
This works very well for users and power settings. If you want to set a time for the options, you can just enter a number at the end of the line instead of 0.
If you have any questions you may contact Ryan at firstname.lastname@example.org
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com