Shutdown a windows PC from linux



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, replacing '111.111.111.111' with the IP address of the remote PC:
net rpc shutdown -I 111.111.111.111 -U theusername
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


Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

Popular Posts