We can normally shutdown a computer using the shutdown icon in the start menu. For system administrators it’s a very common situation where they need to shutdown a computer that’s not at their desk. Reaching to a computer physically consumes one’s time. Remote desktop comes handy for those situations. User can login to a system using remote desktop and they can can reboot/shutdown the computer. But if you have lot of computers which need to be shutdown then doing it from a batch file would be very helpful. Such a command would save lot of time for system administrators. For this purpose there’s a tool called PsShutdown.exe developed by SysInternals.com (Now part of Microsoft). You can see below how to use this tool.
PSShutdown.exe can be downloaded as part of PS Tools from the below location.
To shutdown a computer you can run the below command.
PsShutdown.exe -u username -p password \\Remotecomputer
You would see a message like below after running the above command.
Remote computer is scheduled to reboot in 00.00.20.
If you want to schedule the shutdown at a specific time you can use -t switch to specify the time in 24 hours format. For example, to schedule remote computer shutdown at 3:30 pm today, the command would be:
PsShutdown.exe -t 15:30 -u username -p password \\Remotecomputer
What about the windows in-built Shutdown command ?
The in-built shutdown command does not take user name and password from command line and uses the current logged in user credentials. This would be a problem if the local user does not have privileges to reboot the system. I am also not sure if this command works reliably. I tested this once but got access denied error.
How to Restart a remote computer ?
You can use PsShutdown command even for restarting a remote computer. You can run the below command for this purpose.
PsShutdown.exe -r -u username -p password \\RemoteComputerName
Feel free to share your experiences with remotely shutting down a system. You can use the comments section below for this.