Set up Power Management through Group Policy

ITBanker
ITBanker used Ask the Experts™
on
I would like to create a GPO to keep all of my workstations on all the time instead of going into hibernation after 20 minutes.  Thank you!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Power settings aren't actually natively managable via the supplied ADMs that come with Server/XP.

You might be able to use: http://www.terranovum.com/projects/energystar/ez_gpo.html

You could use powercfg.exe if you're running Windows XP SP2.  See: http://www.microsoft.com/technet/prodtechnol/winxppro/deploy/relnsp2.mspx

Author

Commented:
I have tried the EZ GPO tool and have not been successful with it.  All of my workstations are XP SP2.  How would I use powercfg.exe to get them to stay on?  Specifically, how could I create a GPO so that I won't have to touch all of my workstations?
You really won't be able to accomplish this via GPO if the EZ GPO tool doesn't work for you.  Your options are this point are either place the appropriate powercfg.exe commands in a logon script or run the tool remotely from a management workstation (with the help of psexec.exe).

First, get the powercfg command ready.  Something like: "powercfg /change "Home/Office Desk" /standby-timeout-ac 0"

You could also pop several powercfg.exe commands into a batch file for easier execution.  For example, you might want to go ahead and change the power settings for the default "Portable/Laptop" and "Home/Office Desk" power schemes and for more than one setting.

The next thing is to execute the command remotely on the system via psexec.  See http://www.sysinternals.com/Utilities/PsExec.html for more information on download and usage.  However, your command would look something like this: "psexec \\<remotecomputer> -u <admin_ID> -p <admin_password> -c pmngmnt.bat"
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

Author

Commented:
I am trying to use psexec, but I am getting a message "The specified application is not on the path."  Here's the command line I'm using:  "psexec \\flb056064 -u tacct -p E4t$ui2RRa -c pmngmnt.bat".  What am I doing wrong?
pmngmnt.bat was just the name of the batch file that you might create, containing your powercfg.exe commands in it.

In testing (and for example for that matter), I created a batch file name "test.bat" on my management workstation with the following commands in it:

   powercfg /change "Home/Office Desk" /standby-timeout-ac 0
   powercfg /change "Home/Office Desk" /standby-timeout-dc 0

I then issued the following command to run the batch file on the remote PC:

   psexec \\<remotepc> -u <domainname>\administrator -p <domainadminpassword> -c test.bat

Author

Commented:
Yes, that is what I have done, too, but I did name my batch file pmngmnt.bat.  I am still getting the same error.  Where does the batch file need to be located (i.e. on my PC, on the server)?
The batch file needs to be located on the machine where you're running psexec (I've called it the management workstation) above.  The "-c" option to psexec will actually copy the batch file to the remote PC and then execute it.  The only requirement of the client PC is that powercfg.exe be in %SystemRoot%\System32.

Perhaps the file isn't copying to the remote PC because of account problems.  Is the "tacct" account that you're specifying a local ID on the remote PC?  If so, specify "-u flb056064\tacct" instead and see if that works.  You can also use a domain account (as I've done in my example, above).

Author

Commented:
OK.  That worked as far as executing the command, but now I am getting the following:

"C:\WINDOWS\system32>powercfg /change "Home/Office Desk" /standby-timeout-ac 0

C:\WINDOWS\system32>powercfg /change "Home/Office Desk" /standby-timeout-dc 0
pmngmnt.bat exited on flb056064 with error code 0."

Do you have any idea what an error code 0 is?  

(Sorry to be so difficult!  I'm still fairly new at all of this.)
We've got it!  Error code 0 is generally a good thing, meaning that things exited without incident (ie, the command did what it was supposed to do).

Programs use exit codes to report on the status of execution.  You can check the error code (usually programatically) to see whether or not the utility performed the action that you expected it to.  Sometimes utilities will exit with non-zero exit codes.  It might indicate some sort of problem or the utility might even use the exit code to report back some sort of condition.

Author

Commented:
Wellllllll.......I have tested this out on 2 different machines.  It is not working consistently.  What I am finding is that when I use a local administrator to run the batch file through psexec and then sign into the machine as that local administrator, the standby setting has been changed.  However, when I sign into the machine as any other user (i.e., a regular domain user or even domain admin), the setting is still set go to standby after 15 minutes.  When I log off so that no user is signed in, the machine goes to standby after 15 minutes.  I think I need something that will not be user specific - something that will change the default settings for All Users.

Author

Commented:
OK.  I think I have this figured out now.  Instead of using psexec to run the powercfg command, I added it to my logon script.  That way, every time someone logs on, the power management command runs for THAT user.  It seems that even when the user logs off and leaves the machine at the Ctrl+Alt+Del screen, the power management settings remain intact.  I'm not really sure why that is happening now when it wasn't happening earlier, but I will test it for a couple of days to make sure it is really working.  
Going back and looking at the actual registry values that get updated, they are stored under HKEY_CURRENT_USER\Control Panel\PowerCfg, so the behaviour that you've described is accurate.

I don't see any easy way to just apply this to all existing users on all of your machines.  You could also make some sort of change to HKEY_USERS\.Default Users, but it will only take effect for new users on the machines.

I think to accomplish what you're seeking, you could put the powercfg commands/batch file in a logon script for your users, which would change the setting as soon as they logon to their machines.  It's probably the easiest and more sure-proof way of making the change across the board for all of your users.

Author

Commented:
Yes, that's exactly what I did (adding the command to my current logon script).  What I am not sure of is if the setting will hold even when the user logs off (i.e., leaves the machine at the Ctrl+Alt+Del screen).  I tested this on one machine earlier by leaving it untouched for 30 minutes.  It did not go into standby mode.  I am about to try it on 4 more machines, just to make sure it will work.

Author

Commented:
Apparently the login script did the trick.  None of the 5 machines (except for one that has been problematic in the past) has gone into standby mode after more than an hour sitting at the Ctrl+Alt+Del screen.  I think my problem has been solved.  Thank you so much for your help and your patience!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial