Switch Off Manager is a command line utility that will shutdown or standby a computer based on logged on or connected users.
In situations where you want a computer to be available to multiple remote users but don’t want them to be bothered with shutting down the computer when they are finished using it, you can use Switch Off Manager to periodically check the system for connected or logged on users. When no one is using the computer, it will be shutdown or put in standby mode.
By running the utility in the Windows task scheduler you can have the utility check your systems at a specified interval.
You need the .NET Framework 2.0 or higher to run SwitchOffManager.
Documentation
Usage:
swoffmgr [\\computer] [-l] [-s|-d|-e command [-a]] [-i domain\user[,...]]
\\computer Act on specified computer
-l Consider only logged on users
-s Suspend the computer
-d Shutdown the computer
-e Execute the specified command on the specified computer
-a Execute action ignoring logged on or connected users
-i Ignore the specified user(s)
Suspending is done by executing “rundll32.exe powrprof.dll,SetSuspendState” at the inspected computer. As you might know this will result in hibernating if the option “Enable hibernation” is checked in your Windows power options. To have the computer suspend you have two options:
•you can disable hibernation on the target computer
•you can use a custom tool on the target computer to suspend it
The latter is done by using the -e switch and specify your prefered utility. I can recomend PsShutdown from SysInternals.
To run the utility at a certain interval in the Windows task scheduler you have to set the Advanced options of the task:
Specify no End Date, Check Repeat task, specify the interval and set the duration to be 23 hours and 59 minutes. This will run the task every interval repeating indefinitely.
If you are using Windows Firewall, you have to allow “Remote Scheduled Tasks Management” to unblock SwoffMgr.
If you want to contact me about Switch Off Manager please write me at: feedback at davitools.com.