I'd like to know if it is possible to shut down a Windows Server 2003 box, without have to log into the machine via remote desktop.
The server is on my network, I know the IP address and host name, as well the Administrator password.
I want to shutdown by simply double clicking a shortcut or executing a script.
How do I do this?
Remote shutdown...
Shutdown parameters explained...
PsExec parameters explained...
Batch file example, using local admin account... (paste into Notepad as rsla.bat)
Links...
If you didn't need to specify credentials, you could use the SHUTDOWN command. If you do need to specify credentials (your login doesn't have permissions, or the computer isn't on the domain), you can use the PSSHUTDOWN utility to do this.
Local account:
cmd /k wmic /node:"targetcomputerhostname" /user:"AdministratororWhatever" os where primary=true call reboot
AD account with local admin privileges:
cmd /k wmic /node:"targetcomputerhostname" /user:"DomainAccountWithAdminPrivs@fqdn" os where primary=true call reboot
This is easily portable as a batch file. Keep in mind you will need the proper remote exceptioins. If psshutdown works, this ought to work as well without installing any external software (not to dis SysInternals tools, the one thing Windows I swear by).
Powershell: