Remotely restart or shutdown windows

Introduction.

Sometimes it is useful to remotely restart a windows based machine without having access to a remote session. This recently happened to me on a server (in a different country) which I had asked to restart from a VNC session. For some reason, some of the applications didn't close when asked to by Windows and the server sat there, waiting. VNC server was one of the applications which had closed when asked, and RDP was disabled (for other reasons) so I could no longer access the machine. No-one was at the location of the server, so I needed a way of restarting it from my desk, and quickly!

Guide.

From another Windows machine which has network access to the machine you wish to restart/shutdown, follow the following: