Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have 10 computers running Windows 7 connected to Active Directory. I would like to setup the computers so that they go into standby if no one logs in for 15 minutes, BUT I want the computers NOT to go into standby ever if someone is logged in.

This would involve the changing of Power Plans. Is there a way to have one Power Plan loaded when the computer is not logged in and a different Power Plan loaded when a user is logged in?

UPDATE: Using jscott's suggestions I think I have what I want working. I made a Power Plan called Logged_In for the User Configuration and Logged_Out for the Computer Configuration. The last glitch I had to fix was that Logged_In was applied after logout until the next policy refresh. I made the following script to run at logout based on code I found >here<:

Set objShell = WScript.CreateObject("WScript.Shell")
Set objWshScriptExec = objShell.exec("powercfg.exe -list")
Set objStdOut = objWshScriptExec.stdOut

While Not objStdOut.AtEndOfStream
   strLine = objStdOut.ReadLine
   If InStr(strLine,"Logged_Out") Then
      strGuid = Mid(strLine,20,37)
   End If   
Wend
objShell.run "powercfg.exe -setactive " & strGuid
share|improve this question
add comment

1 Answer

The best way to do this is to create a GPO. You'll want to look under Computer Configuration, Preferences, Control Panel Settings, Power Option. Then right click and select New, Power Plan. From there you can specify all the power settings you want. Here is a technet article.

http://technet.microsoft.com/en-us/library/dd759141.aspx

share|improve this answer
    
But how do you automate the changing of the Power Plan? –  Joseph Aug 12 '11 at 14:19
1  
@Joseph - Via group policy. –  voretaq7 Aug 12 '11 at 15:06
1  
@joseph Assign a computer configuration Power Plan for the computer settings. Assign a user configuration Power Plan for the user settings. When nobody is logged in, the Computer Power Plan will be used. –  jscott Aug 12 '11 at 15:23
    
@jscott How do you change it back to the Computer Configuration after a user has logged out? –  Joseph Aug 12 '11 at 19:02
    
@Joseph Both the computer and user will have their own Power Plans -- that is you configure one under Computer Configuration, the other under User Configuration. When a user is logged on, the User Configuration GP settings are active. When a user logs off, the User Configuration settings will fall out-of-scope and the Computer Configuration GP will be the active settings. –  jscott Aug 12 '11 at 19:40
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.