Archiv

Artikel Tagged ‘shutdown’

PsShutdown – Remote reboot und Shutdown von Windows Systemen

PsShutdown von Sysinternals  – Remote reboot und Shutdown von Windows Systemen
PsShutdown ist mit das einfachste Tools aus der PsTools Box, dabei kann es im Vergleich zu den Windows Bordmitteln schon viel. Mittels PsShutdown kann man Windows basierte remote Systeme leicht herunterfahren, oder rebooten. Hierbei kann man dem Tool auch Authentifizierungsinformationen wie den Benutzernamen, Kennwort und Domäne mitgeben, so das durch PsShutdown es ermöglicht wird, von Domänenfremden Systemen aus einen Reboot oder Shutdown eines Windows Systems einer anderen Domäne zu befehlen, ohne sich auf das System direkt zu verbinden. Dies macht PsShutdown sehr gut für Einsätze im Scripting geeignet!

Auch kann mittels PsShutdown nicht nur ein Rechner “ferngesteuert” werden, hier können beliebig viele Rechner zeitgleich gesteuert werden, sofern die Credentials, also die Logininformationen wie Benutzername, Domäne und Kennwort bei diesen Systemen übereinstimmen.

Kurzfassung der offiziellen Manpage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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.

Häufige Kommandozeilen, welche ich selbst im Einsatz habe:
(Falls jemand Fehler in den Kommandos findet – Info an mich bitte)

Reboot eines einzelnen Systems innerhalb meiner Domäne

1
psshutdown \\servername -r -t 1

Reboot eines domänenfremden Systems

1
psshutdown \\servername -u domain\username -p password -r -t 1

Reboot eines Terminalservers um 12 Uhr mit Vorwarnung & Vorwarnzeit an die Benutzer (erzwungen)

1
psshutdown \\servername -f -t 12:00 -r -v 900 -m "Reboot um 12:00 Uhr!"

Shutdown einer ganzen Reihe von Systemen (Liste per Textfile)

1
psshutdown @serverliste -r -t 1

Shutdown eines Systems mit Angabe des Grundes für das Eventlog

1
psshutdown \\servername -e p:04:06 -r -t 30

Shutdown aller Rechner in einer Domäne

1
psshutdown \\* -k -f -t 1

Reboot eines Systems mit Abbruchmöglichkeit durch den Benutzer

1
psshutdown \\servername -c -r -t 90

Abbruch des Shutdown eines Systems

1
psshutdown \\servername -a

Weblinks: