By David Hardy
David Hardy explains how to force all Windows 2000/XP workstations on your network to shutdown at certain time. He uses a custom package in ZENworks Patch Management 6.3.
In our environment, we wanted to be sure all PCs were shut down overnight. To do this, I created a batch file using the ‘schtask’ command and psshutdown.exe to create a shutdown task at 11:30 each night. After creating this batch file, I sent it out and executed the file with ZENworks Patch Manager.
- Download PsShutdown (free).
- Create batch file. Here is the batch file I used:
schtasks /create /tn shutdown /tr "c:\patch\psshutdown.exe /accepteula -c -t 300" /sc daily /st 23:30:00 /ru system
The first part creates a task named “shutdown”.
Starting with “C:\patch\....”, The “patch” directory is where we always place files sent out with Patch Manager.
This section configures the parameters of the task. If you want the task to run without user intervention, you must put the ‘accepteula’ switch in the task.
The “–t 300” gives users a warning that the pc is going to shutdown in 5 minutes (300 seconds) As you can see, it runs daily at 11:30 pm (24 hour format).
- Place this batch file (along with psshutdown.exe) in the same directory. Again I use C:\Patch.
Disclaimer: As with everything else at Cool Solutions, this content is definitely not supported by Novell (so don't even think of calling Support if you try something and it blows up).
It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.