Shutdown Windows and Linux Servers remotely

WinWorker 61 Reputation points
2020-11-24T14:39:09.627+00:00

Hi All,

In my environment I have Windows and Linux servers. I've been creating a script to shutdown both SOs remotely. In Windows 10 and 2016 etc., there's an ssh client embedded. However, We use Windows 8 and Windows Server 2012, Hence, I need to use a non-native option, like Putty. Putty has plink command, and I can shutdown Linux Servers by using this command. But, this is an issue: when I shutdown a remote linux, the following event occurs:

C:\Program Files\PuTTY>"C:\Program Files\PuTTY\plink.exe" -ssh 10.0.1.57 -l root -pw 123abc1 shutdown -r now
Access granted. Press Return to begin session.

And obligatorily I have to press Enter to go on the command.

Is there a way to execute this command without pressing Enter, since I'll use this command in a script that will shutdown both Windows and Linux Servers in my network?

Thank you very much.

Windows for business Windows Server User experience Other
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2020-11-24T14:53:01.43+00:00

    Try the following switches.
    -no-antispoof
    -batch

    --please don't forget to Accept as answer if the reply is helpful--

    2 people found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. WinWorker 61 Reputation points
    2020-11-24T15:49:23.56+00:00

    @Anonymous

    Thank you very much! It worked like a charm!

    Have a nice day!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.