Friday, January 23, 2009

Restarting a remote machine: XP and Windows 2003

How do you restart a remote machine, like an XP controlled by remote desktop or a Windows 2003 server running terminal services? At least with Windows 2003 server you see a grayed out button when you try to shutdown or restart from a remote desktop session.

In Windows NT and 2000 you could install the “remote shutdown tool” on your remote machine but Microsoft pulled it, perhaps because they had a rather serious security problem related to remote shutdown in XP SP1.

I couldn’t find much Microsoft documentation on how this works for XP, but it’s still supported. Just fire up the command line and type “shutdown –i”. In theory you need admin privileges on the remote machine for this to work (the SP1 bug allowed non-admin users to do remote restarts with another tool).

I can confirm this works on Windows 2003 server, though there is a known bug that can affect some machines.

Restart or shut down remotely and document the reason explains how to do it. You have to know the machine name of the remote machine and you have to have admin privileges on the remote machine associated with your network name. Oddly enough the documentation there uses / for an option delimiter, but if you type “shutdown” the directions use hyphens.

From a command prompt “shutdown –i” gives you a handy GUI (you can tediously browse the network for the machine), or just type this command line (where N4591Fred is not my real machine name) …

shutdown -r -m \\N4591Fred –t 0 -c "bug fixes"

The command line example above will shutdown with no warning, but it still takes a few minutes to shutdown, restart, etc.

Update: I’ve been told that if you’re connected to a remote server you can run the “shutdown.exe” command from the remote machine command line. I haven’t tried that yet.

No comments:

Post a Comment