Keywords windows xp, login window, logon window, energy settings, energy profile, power settings, power profile -- Summary The energy profile that is active at the login window in XP can be manipulated with the use of logon/logoff scripts. The default behavior is for members of the Administrators and Power Users groups to have their energy profiles stay active after logging off. The profile will not change until another member of these two groups logs in. Interestingly, I found that by changing the permissions on HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg, you can give other users or groups the ability to have their energy profiles applied at the login window. Default Behavior I have searched for some time for a foolproof way to make Windows XP Pro SP3 go into standby and hibernate modes at the login window. While I had some success by setting the power settings for the Administrator account, over time the power settings were lost and I found all of the computers in the labs that I help manage were staying on all the time. The following is what I discovered about the behavior of energy settings in XP and a solution for setting the energy profile at the login window once and for all. I had read any number of places online that the energy settings of the Administrator account affect those of the login window, at least for SP3. While I found this to be true, I also discovered that any other accounts in the local Administrators group would have their energy settings applied to the login window after logging out. Since there are multiple local accounts (and some AD groups) that are members of the Administrators group (and not all of their energy settings are the same), any time someone would login/logout as a local administrator, the energy settings of that account would be applied to the login window until the next administrator logged in with different energy settings. To replicate the described behavior yourself, create two local accounts on your XP Pro SP3 machine, making both members of the Administrators group. Login to one of the new accounts (say, admin1) and set the energy settings. Log out, then login as the second account (say, admin2) and set its power settings. (You might want to make the timeouts relatively short [~1 or 2 minutes] so you aren't wasting a bunch of time waiting for the computer to go into standby!) Now, log in and out as admin1, noting the timeouts for monitor blanking, standby, and hibernate. Use your watch to time it to make sure it's in the ballpark. After you've satisfied yourself that admin1's energy settings apply to the login window, log in as admin2, note its energy settings (make sure they are different than admin1's!), and log out. Again, use your watch to note the timeouts. You should find that the login window's energy settings are now identical to those of admin2. The reason for this behavior is the default permissions on the key HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg. By default the Administrators and Power Users groups have permissions to set values in this key, meaning that members of the Power Users group will have the same effects on the energy profile settings at the login window as Administrators. To control the energy settings at the login window, we can create two scripts (one each for logon and logoff). These scripts use the command line program powercfg to create, edit, and apply energy profiles for user accounts. For syntax help, use powercfg /? at a command prompt. After creating the scripts, we will use Group Policy to apply them to all local users. Here is what I used for the logon script: REM power_logon.bat powercfg /SETACTIVE "Always On" This sets the built-in Always On profile to be active when a user in the Administrators or Power Users group logs in. This will not apply to all other users. For users that do not have permissions to change the energy settings (e.g., members of the Users group), the active profile will be the one set in the Default User profile (unless their registry hives have been edited). Here is the logoff script: REM power_logoff.bat powercfg /CREATE "Lab" powercfg /CHANGE "Lab" /monitor-timeout-ac 5 /disk-timeout-ac 10 /standby-timeout-ac 10 /hibernate-timeout-ac 15 powercfg /SETACTIVE "Lab" This creates an energy profile called Lab, establishes its settings, then applies it as the user is logging out. This will make it apply to the login window, provided that at least one administrator has logged in and out. If an energy profile named Lab already exists, this will simply change its settings. There will not be as many Lab profiles created as times a user has logged in! To integrate these scripts into the Group Policy settings, we need to place them in %windir%\system32\GroupPolicy\User\Scripts\<Logon or Logoff>. (Note that the GroupPolicy folder is hidden.) Then, we need to add them via the Group Policy snap-in (Start->Run->gpedit.msc). Navigate to User Configuration\Windows Settings\Scripts (Logon/Logoff). Double-click on each of the objects and add the batch files we created earlier to their respective objects (power_logon.bat to Logon, power_logoff.bat to Logoff). At the next log on/off of an administrator, the scripts will run and apply the settings we scripted. You can push out these Group Policy objects with Active Directory to machines in the domain, or you can manually add them to each machine. For a lab environment, if all of the Group Policy settings are the same, you can configure one machine's settings, copy the contents of the %windir%\system32\GroupPolicy folder, and create another script to copy the new Group Policy settings onto another computer and apply them. This can be accomplished with a script like this one: xcopy "\\server\your_directory\GroupPolicy\*.*" "C:\WINDOWS\system32\GroupPolicy\" /H /E /I /Y gpupdate /Force Note that xcopy may not parse %windir% correctly, so you may have to specify the full path as above. Also, while it may seem like overkill to copy all of the group policy settings rather than simply updating the ones already there, I couldn't find an easy way to accomplish this. Tweaks As mentioned above, since the permissions on HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg dictate whether or not a user is able to change the energy profile, you can change the permissions on the key so that others can set the energy settings. This means, of course, that whomever you grant permissions to will have their energy profile applied at the login window after logout. Specifically, if you want to grant a particular user these rights, you can grant Full Control on all keys and subkeys. Final Thoughts I hope that someone else finds this method useful. It will certainly help us conserve energy in our computer labs if nothing else. I understand that the energy-related bits of Vista/7 are quite a bit different, but since we haven't switched over I haven't had a chance to fiddle around with them yet. -- Resources: Saving Power on idle PCs Power Management Using Powercfg.exe in a logon script to configure power management settings : ENERGY STAR Windows shutdown script. Scheduling Power Scheme Changes In Windows XP | mdgreenfield.com Microsoft: Windows XP Pro - How tdo I copy/distribute Local Group Policy to all PCs...