Does anyone know of a free software that can be installed on a Windows 2003 server to set a schedule task to shut down computers at night/start them in the morning?
This scheduled batch file does it for us
echo "Starting PC Shutdown script" > "C:\Winapps\Logoffs\shutdown.log"
echo "Starting LimitLogon clearout" >> "C:\Winapps\Logoffs\shutdown.log"
"C:\Program Files\LimitLogin\llogincmd.exe" /c
echo "Starting PC Shutdown" >> "C:\Winapps\Logoffs\shutdown.log"
C:\winapps\logoffs\PSShutdown.exe -c -k @PCList.txt -f -t 30 >> C:\Winapps\Logoffs\shutdown.log
echo "Completed" >> "C:\Winapps\Logoffs\shutdown.log"
You just need psshutdown (free download)
Easy enough to do ...
Create a text file of the machine names to shutdown, for each room for example, then name it room1.txt
Then create a bat with the command, here is the one I use.
psshutdown -k -m "Computer will soon power down, save NOW" @room1.txt
There are switches that can be used to do the desired function you require.
Usage: psshutdown [[\\computer[,computer[,..] | @file [-u user [-p psswd]]] -s|-r|-h|-d|-k|-a|-l|-o [-f] [-c] [-t nn|h:m] [-n s] [-v nn] [-e [u|p]:xx:yy] [-m "message"]
- Displays the supported options.
computer Perform the command on the remote computer or computers specified. If you omit the computer name the command runs on the local system, and if you specify a wildcard (\\*), the command runs on all computers in the current domain.
@file Run the command on each computer listed in the text file specified.
-u Specifies optional user name for login to remote computer.
-p Specifies optional password for user name. If you omit this you will be prompted to enter a hidden password.
-a Aborts a shutdown (only possible while a countdown is in progress).
-c Allows the shutdown to be aborted by the interactive user.
-d Suspend the computer.
-e Shutdown reason code.
Specify 'u' for user reason codes and 'p' for planned shutdown reason codes.
xx is the major reason code (must be less than 256).
yy is the minor reason code (must be less than 65536).
-f Forces all running applications to exit during the shutdown instead of giving them a chance to gracefully save their data.
-h Hibernate the computer.
-k Poweroff the computer (reboot if poweroff is not supported).
-l Lock the computer.
-m This option lets you specify a message to display to logged-on users when a shutdown countdown commences.
-n Specifies timeout in seconds connecting to remote computers.
-o Logoff the console user.
-r Reboot after shutdown.
-s Shutdown without power off.
-t Specifies the countdown in seconds until the shutdown (default: 20 seconds) or the time of shutdown (in 24 hour notation).
-v Display message for the specified number of seconds before the shutdown. If you omit this parameter the shutdown notification dialog displays and specifying a value of 0 results in no dialog.
I run the bat on a scheduled task every night, works well.
Windows actually comes with a tool for shutting down computers, I'm still amazed at the amount of 3rd party solutions out there
This will shut down the machine after a 120 second countdown with the message supplied. We usually run this to give straggling users a chance to save their stuff before we force them off.Code:shutdown -m \\somecomputer -s -t 120 -c "All systems are shutting down, please save your work."
We simply reduce the time to 1 second if we're pretty sure we want the machines off in next to no timeCode:shutdown -m \\somecomputer -s -t 1
Restarts the specified machine immediately.Code:shutdown -m \\somecomputer -r -t 1
Abort a shutdown after it has launched (provided you get in on time)Code:shutdown -m \\somecomputer -a
Throw some of this into a batch file (say: entire rooms) and you have yourself one powerful offswitch and no additional software needed
Of course if you want to do some stuff like locking pc's e.t.c. thats a different kettle of fish (and will need tools as mentioned by others above), but you don't need anything more if you just want to shutdown/restart things.
Last edited by Friez; 9th September 2008 at 01:26 PM.
I thought standard "shutdown" choked if the PC was running a screensaver - which would make it a bit tricky?
I manage to achive this by creating a vb script that executes the windows shutdown comand to shutdown the machines, and a free util called mc-wol to wake them up.
shtudown -s -t 01 -m \\'computer name'
I wrote a program this week to handle this kind of problem. What we wanted was an automatic way to shut down the whole site but with a few extra requirements, namely:
- 100% automatic, no editing lists of computers
- Full GUI, no command prompt, no VBS
- Exclusion list for admin computers + servers
- Must run as a scheduled task
The coolest feature of the tool is that it's always up-to-date with the computers that need shutting down. On startup, it queries the PackageControl folder and gets a list of all the domain computers from there, no servers in that list either so no danger of shutting them down.
Second neat thing, it uses WMI both to do the shutdowns and to check which computers are online before starting the shutdown process. That means no waiting for ages while the command prompt sits there, waiting to timeout.
Also, there's a full GUI showing the computers in the shutdown queue and any computers that failed to shutdown.
There's no schedule feature, it just runs as a scheduled task. It's RM only at the moment because it depends on the PackageControl folder for its information. If any RM users would find it useful, PM me for a copy.
Last edited by bizzel; 9th September 2008 at 06:08 PM.
I've seen it hang when the screensaver is active. It's not permanent but takes about 30 seconds of just sitting the logon background before it shuts down.
Earler versions of Windows didn't come with shutdown (I think it was first in 2000 but it might not have been there until XP) so other techniques were needed.
Using scripts and WMI lets you do things like checking if the machine is switched on and needs switching off; checking the OS so you don't shut down servers and so on.
If you want a shutdown at a relatively fixed time each day then you can just schedule a task to run on the local machine at the appropriate time - perhaps changing the time by using a machine startup script.
I schedule beyondexec shutdown (BeyondExec - Spawn Processes or Shutdown Remote Windows NT/2000/XP WorkStations) with the startup script.
If you do it with AT (NOT schtasks which can't do interactive properly) then the user gets a popup asking if they want to shutdown and can abort it, popup is also displayed on machines that are not logged in which is nice.
I'm resurrecting this, as our current method of turning computers off (BeyondExec) no longer seems able to touch locked computers.
Reading other threads on this, there seems to be some dispute over whether or not PSShutdown can do this in a single pass - what are people's experiences? Also, does PSShutdown offer users the ability to cancel a shutdown if they are still working?
There are currently 1 users browsing this thread. (0 members and 1 guests)