Posted On March 31, 2019

Servers Reboot Script

kimconnect 0 comments
blog.KimConnect.com >> Codes >> Servers Reboot Script
rem method 1: machines that are part of the domain
sc \\DOMINO01 stop "Lotus Domino Server (LotusDominoData)"
sleep 90
for /F "tokens=3 delims=: " %%H in ('sc \\DOMINO01 query "Lotus Domino Server (LotusDominoData)" ^| findstr " STATE"') do (
if /I "%%H" == "STOPPED" (
rem shutdown -r -m \\DOMINO01 -t 0
)
ELSE IF /I "%%H" == "RUNNING" (
sc \\DOMINO01 stop "Lotus Domino Server (LotusDominoData)"
sleep 120
rem shutdown -r -m \\DOMINO01 -t 0
)
)
sleep 300

rem method 2: machines that are not joined to domain
start psexec \\DOMINO01 -e -h -u DOMINO01\administrator -p PASSWORD net stop "Lotus Domino Server (DLotusDominodata)" && shutdown -r -m \\DOMINO01 -t 0

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Basic CSS: Override Class Declarations by Styling ID Attributes

<style>body {background-color: black;font-family: monospace;color: green;}.pink-text {color: pink;}.blue-text {color: blue;}</style><h1 class="pink-text blue-text">Hello World!</h1>

How to Import Files Into a Docker Container

1. Use SCP to copy files to the remote server while logged onto the local…

PowerShell: Test URL for Reachability

function testUrl($url){ try{ $HTTP_Request = [System.Net.WebRequest]::Create($url) $HTTP_Response = $HTTP_Request.GetResponse() [int]$HTTP_Status = [int]$HTTP_Response.StatusCode If ($HTTP_Status -eq…