Two Minute Drill: Shutdown.exe, Tsshutdn.exe and Psshutdown.exe

Two Minute Drill: Shutdown.exe, Tsshutdn.exe and Psshutdown.exe

  • Comments 3
  • Likes

Hello all, Shipra here with a brief discussion of the various tools available to remotely shut down a system, and which is appropriate to use under which circumstances.

The first is Shutdown.exe, which originally shipped with the Windows 2000 Resource Kit. This is a good all-purpose tool for controlling machine shutdowns and reboots. However, it is not really capable of intelligently handling multi-user logons, so on a terminal server for instance, it will blindly reboot the server when you tell it to without warning to the terminal server users. This could cause possible data loss for the users if they have not recently saved their data. This tool is only available on the Windows 2000 Server Resource Kit, and not available for download, largely due to being superseded by our newer tool, which is…

Tsshutdn.exe, designed with terminal servers in mind, but works fine with other roles too. This tool uses functionality that makes it aware of multiple users and sessions, and will notify said users that the machine is being rebooted. This is of course invaluable in a terminal server environment and much preferable to blindly shutting down without regard to users. Using Tsshutdn.exe, the users get notified that the shutdown is coming, as well as prompted to save data within open applications. The basic syntax is:

Tsshutdn wait_time [ /server:server_name] /reboot /powerdown /delay:log_off_delay /v

You can use the following parameters with the Tsshutdn command:

· wait_time: Use this parameter to specify the time period to wait (after users are notified) after which users are logged off from their sessions. The default setting is 60 seconds.

· /server:server_name: Use this parameter to specify the Terminal server that you want to shut down. If you omit this parameter, the current Terminal server is shut down.

· /reboot: Use this parameter to shut down and restart the Terminal server after client sessions are ended.

· /powerdown: Use this parameter to turn off the Terminal server (if the computer supports Advanced Power Management).

· /delay:log_off_delay: Use this parameter to specify the time period to wait (after users are logged off from their sessions) after which all processes end and the Terminal server shuts down. The default setting is 30 seconds.

· /v: Use this parameter to display information about the actions that are performed if you run this command

The third helpful utility is called Psshutdown.exe, from Sysinternals. This tool is similar to Tsshutdn.exe with the added functionality of being able to logoff a specific user, abort an imminent shutdown, lock or even hibernate the computer. More info on this tool and its capabilities is available on the Sysinternals website.

These tools all function in slightly different ways, so there may be no one-size-fits-all solution for your shutdown needs. I have seen cases where a non-terminal server was being rebooted using Shutdown.exe, but would not shut down properly. By switching to Tsshutdn.exe, everything worked as expected.

Thanks for your time, and I hope this information has been of help to you.

Shipra

Share this post :


Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • couple things worth pointing out

    -the article says shutdown.exe is only available in the 2000 server resource kit (this is false as shutdown is bundled in every recent windows OS i checked XP, 2003, 2008, Vista)

    -tsshutdn.exe is not part of windows 2008 (as far as i can tell)

    -shutdown.exe in newer versions of the OS (e.g. 2003, 2008) has support for shutdown events and other options

  • You write that shutdown.exe is only available in the Windows 2000 Server Resource Kit, but AFAIK shutdown.exe is available in both Windows Server 2003 and Windows Server 2008 - alongside tsshutdn.exe...

  • "The third helpful utility is called Psshutdown.exe, ... with the added functionality of being able to logoff a specific user, ..."

    How does one log off a specific user with psshutdown.exe?  It's not clear in the parameters or documentation.