Home > How-Tos > Remotely shutdown a Windows PC from Linux

Remotely shutdown a Windows PC from Linux

August 25th, 2008

A remote Windows PC can easily be shutdown, assuming you have Samba installed on your Linux box, and you have a user account on the Windows PC that has the necessary rights.

Just enter the following command, where ‘thehostname’ is the hostname of the remote PC, and ‘theusername’ is a valid user account on the remote PC:

net rpc shutdown -S thehostname -U theusername

If the hostname is not known, or cannot be resolved, then use the following instead, where ’123.123.123.123′ is the IP address of the remote PC:

net rpc shutdown -I 123.123.123.123 -U theusername

For more information on the command, just enter the following:

net help shutdown

Additionally, the parameters that can be used with Windows’ own shutdown command such as ‘-f’ to force or ‘-t’ to set a timeout, can also be applied to the net rpc shutdown command as well. For example the following will wait 60 seconds, and then force all running programs to terminate before shutting down:

net rpc shutdown -S thehostname -U theusername -f -t 60
Categories: How-Tos Tags: , , , ,
Comments are closed.