Shutdown Windows machine from linux terminal

ganesshkumar picture ganesshkumar · Mar 30, 2012 · Viewed 54.1k times · Source

I am running an application on linux machine. By giving the ip address of a windows machine as input, the application must shutdown the windows machine. If the machines run the same OS it is very easy but I'm confused how to do it in cross OS.

Answer

ganesshkumar picture ganesshkumar · Mar 30, 2012

Command to shutdown windows system from linux -:

$ net rpc -S <ip address> -U <username>%<password> shutdown -t 1 -f

This command can be issued from bash or even set in cron job to shutdown the computer at a specific time and this command is shipped with many distros by default.