![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Windows NT/2000/2003 Server/2008 Server Find support for Windows NT/2000/2003 Server/2008 Server editions. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Registered User
Join Date: Jun 2009
Posts: 20
OS: Windows XP SP3
|
Group Policy Power Management for Workstations
Hello,
Wondering if anyone has an answer or can lead me in the right direction. We currently control the power settings for our windows xp workstations through a group policy from our domain controller. I can modify the policy to place the computers to sleep after a certain period of inactivity. The only issue is that management doesn't want to be on a 1 hour conference and have their workstation go to sleep. The only solution for us would be to find a way to detect if the user is logged out of the workstation and then place the PC to sleep due to inactivity. I found the below script on the EPA website but it won't run due to syntax errors. I was able to fix the syntax errors and create a scheduled task via a startup script but the script fails to detect the log on status and puts the computer to sleep everytime the script runs. Anyone out there know enough VB scripting to correct this script. I don't understand why it won't run. '** Script Name: "standby-hibernate.vbs" ** Option Explicit On Error Resume Next Dim strComputer, sUserName, bLoggedOn, bReboot, objWMIService, colComputer, objComputer Dim bStandby, objShell strComputer = "." Set objShell = WScript.CreateObject("Wscript.Shell") Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colComputer = objWMIService.ExecQuery _ ("Select * from Win32_ComputerSystem") For Each objComputer in colComputer sUserName = objComputer.UserName 'WScript.Echo "UserName: " & objComputer.UserName If sUserName <> "null" Then bLoggedOn = True End If Next If Err = 0 Then If bLoggedOn Then WScript.Echo strComputer & " is not Logged Off." bStandby = False Else WScript.Echo strComputer & " is Logged Off." bStandby = True End If Else WScript.Echo "Error accessing computer: " & strComputer bStandby = False End If On Error Goto 0 WScript.Echo "bStandby: " & bStandby If bStandby = True Then WScript.Echo "Going into standby..." 'Go to standby objShell.run "%windir%\psshutdown.exe -d -accepteula", 0, False Else WScript.Echo "Not going into standby..." End If **************************************************** |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
![]() |
| Thread Tools | |
|
|