Tuesday, November 29, 2011

Restart Remote server from CMD

You must have same rights on the machine you are running this from

shutdown /r /m \\severname

1 comment:

  1. Yes, you can simply use shutdown.exe command. But do not use -i switch, it's not necessary :) (displays GUI during reboot process)

    just use this simple syntax on server

    shutdown /r /f /m \\ServerName /t 00

    or on client machine

    shutdown -r -f -m \\ServerName -t 00

    /r -> reboot

    /f -> force reboot (if any opened application doesn't allow reboot)

    /m -> machine to reboot

    /t -> time in secods before reboot (00 - immediately)

    You can of couse use this syntax with batch. Create a text file with all servers to reboot, each server name in separate line, i.e.

    server1

    server2

    server3

    save it on C-Drive and run from command-line

    for /f %i in (c:\server.txt) do shutdown -r -f -m \\%i -t 00

    it will sequentially reboot servers


    --------------------------------------------------------------------------------

    ReplyDelete