Das Programm wird auf den Workstations mit Hilfe einer Batchdatei gesteuert. Diese Batchdatei installiert auf den Workstations einen Dienst Poweroff, der den Rechner dann zu einer festgelegten Uhrzeit herunterfährt.
Öffnen Sie die Datei (Rechtsklick - Bearbeiten) und geben Sie Folgendes in eine Zeile ein (das können Sie ausschneiden und einfügen, wobei Sie den Namen Ihres Servers eintragen müssen):
\\Name_Ihres_Servers\pgm$\poweroff\poweroff poweroff -warn -warntime 300 -msg "Der Rechner wird in 300 Sekunden heruntergefahren\nZum Fortsetzen Ihrer Arbeit klicken Sie auf CANCEL." -force -scheduled -time 18:00 -days m,t,w,th,f,s,su -create_service
| -warn | Warnmeldung wird vor dem Herunterfahren angezeigt |
| -warntime 300 | Anzeigedauer der Warnmeldung, hier sind 300 Sekunden eingestellt |
| -msg |
Text der Warnmeldung \n erzeugt eine neue Zeile |
| -force |
Offene Anwendungen werden geschlossen |
| -scheduled | geplantes Ausführen, hier zu einer bestimmten Zeit an bestimmten Tagen |
| -time | gibt die Uhrzeit an, zu der der
Rechner heruntergefahren wird |
| -days | gibt die Tage an, in unserem
Fall sind alle Wochentage ausgewählt (m=monday, t= tuesday usw.) |
| -create_service |
installiert den Dienst |
| -notray |
es wird kein Symbol in System
Tray angezeigt |
Alle Optionen sehen Sie in der Hilfedatei unter Poweroff\doc oder am Ende dieser Anleitung
Computerkonfiguration =>
Windows-Einstellungen => Skripts => Starten => Hinzufügen
=> Durchsuchen
Hier wählen Sie nun die eben erstellte Poweroff.bat aus, bestätigen alles
und sind fertig
Fügen Sie dazu in der Batchdatei folgende Zeile ein, und zwar vor die ober erstellte Zeile:
\\Name_Ihres_Servers\pgm$\poweroff\poweroff poweroff -remove_service .
Passen Sie in der zweiten Zeile Ihre Einstellungen an. Die Batch sieht dann also so aus:
\\Name_Ihres_Servers\pgm$\poweroff\poweroff poweroff -remove_service
\\Name_Ihres_Servers\pgm$\poweroff\poweroff poweroff -warn -warntime 300 -msg "Der Rechner wird in 300 Sekunden heruntergefahren\nZum Fortsetzen Ihrer Arbeit klicken Sie auf CANCEL." -force -scheduled -time 17:00 -days m,t,w,th,f,s,su -create_service
Beachten Sie, dass die Änderungen erst nach dem zweiten Neustart übernommen werden. (Manchmal brauchte es bei mir auch drei Neustarts.)
Beim ersten Neustart wird der Dienst zunächst gelöscht. Das DOS Fenster erscheint etwas länger. Beim zweiten Neustart wird der neue Dienst erstellt.
Ausführliche Dokumentation der Command-line options
You can control every option and setting from the command-line. This makes poweroff excellent for use in batch files. Some options have changed since previous releases, so check your batch files! If you do poweroff /?, you will get an overview of all the options (look above for a description of all the settings):Usage: poweroff action [options] Actions: logoff, reboot, shutdown, poweroff, standby, hibernate, lock, wol, monitor_off, monitor_on or no_action Options: -warn : Show a warning message before doing the action -warntime s : Show the warning message for s seconds -playsound : Play a sound when the warning is displayed -soundfile �f� : Specifies the .WAV file that must be played -msg "m" : Specifies the warning message, use \n for a newline character -force : Force applications to close -wait s : Wait s seconds before checking the time -remote m : Do the action on the remote machine m (name or ip) -remschedule : Do the scheduling on the remote machine -use_nt : Use the NT protocol to shutdown/reboot a remote machine -port p : Use port p to connect to the remote machine -username u : User NT username u to connect to the remote machine -password p : Use password p to connect to the remote machine -run : Run a program before doing the action -program "p" : Runs program p before doing the action -directory "d" : Start the program in directory d -notray : Do not show poweroff icon in the system tray -nocancel : Do not allow the user to cancel the action from the tray or in the warning dialog -immediate : Perform the action immediately (default) -scheduled : Perform the action in a scheduled manner -time hh:mm : Perform the action at the specified time -date dd/mm/yyyy: Perform the action on the specified date -days [m,t,...] : Perform the action on the spcified days of the week (m,t,w,th,s,su) -weeks [1,..,5] : Perform the action on the spcified weeks (default=all weeks) -day d : Perform the action on the specified day of the month (1-31) -seconds n : Perform the action after n seconds -process p : Perform the action when a process named p does not exist anymore -ip ip : Specifies the ip adress for WOL -subnet s : Specifies the subnet mask for WOL -mac m : Specifies the mac address for WOL -allow_remote : Allow remote control -remote_port p : Listen on port p for commands -remote_pswd p : Set a password that clients must give for remote control -simulate : Simulate all actions, do not perform them -minimize : Start minimized in the system tray -quiet : Don't display error messages -save_settings : Saves current settings to the registry -remove_settings: Remove the settings from the registry -save_svc_set : Save current settings to the service -remove_svc_set : Removes the service settings -create_service : Creates the poweroff service, including the settings -remove_service : Removes the poweroff service, including the settings -debug : Start poweroff in debug mode
Examples:
The following command shuts down the pc after giving a 10 second warning.
C:\poweroff\poweroff poweroff -warn -warntime 10 -msg "You will be logged off in 10 seconds"
The following command creates a service that shuts down the pc everyday at 23:00, forces all applications to close, gives a warning to the user, plays a sound file when the warning dialog is shown and listens for remote control using a password:
C:\poweroff\poweroff poweroff -warn -warntime 60 -msg "You pc will poweroff in 60 seconds\nPlease save your work" -playsound -soundfile "d:\winnt\media\ringin.wav" -force -scheduled -time 23:00 -days m,t,w,th,f,s,su -allow_remote -remote_pswd password -create_service
The following command will shutdown a remote computer using the standard NT protocol:
C:\poweroff\poweroff poweroff -remote computer -use_nt -username computer\administrator -password password
The following command will reboot the computer after a program (cmd.exe) has finished:
C:\poweroff\poweroff reboot ?process cmd.exe
The following command will wake up a remote computer:
C:\poweroff\poweroff wol ?ip 10.0.0.1 ?subnet 255.255.255.0 ?mac 0050BF0852A2
The following command will log off the user 60 minutes after logging on when the command is put inside the startup folder. The user will not be able to see that poweroff is running and will not be able to cancel it:
C:\poweroff\poweroff logoff ?scheduled ?seconds 3600 ?notray ?nocancel ?force
This command simply powers off your computer:
C:\poweroff\poweroff poweroff