K
K
kondrash0552014-03-26 13:43:47
Windows Server
kondrash055, 2014-03-26 13:43:47

How to write a script to shutdown servers?

Good afternoon. There are two win2008r2 servers. You need to write a script to turn them off. First one turns off, after 15 seconds the second.
As I understand it, it is necessary to give users the ability to work with power through group policies.
Then duplicate user accounts on the second server so as not to reveal the admin password, and create *.bat with the following content:
shutdown -s -t 0 -f -m \\xxx.xxx.xxx.xxx
sleep 15
shutdown -s -t 0 -f -m \\xxx.xxx.xxx.xxx

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Pavel Vasterov, 2014-03-28
@zxc80

Nobody answers you, because You answered yourself :-)

A
Alexander Nikitin, 2014-03-28
@padla2k

Why Sleep 15 if you can
shutdown -s -t 15 -f -m \\xxx.xxx.xxx.xxx (this is the second one)
shutdown -s -t 0 -f -m \\xxx.xxx.xxx.xxx (this first)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question