locked
Reboot script - Define when the server is up again? RRS feed

  • Question

  • Hello !

    I'm trying to create a Reboot script, but I have a question about, how I can define, when the server it's up again. 

    What I mean about "when the server is up", in example; If I have a DC to reboot first, then I need a service or another option, that I can use to define the server it's up again, so the script can go to the next server on the list, but the twist is that I am looking for a service that can be used  to define "all" kind of servers (SQL, DC, File, NAV, Axapta, ect.)

    Do someone have a good idea how i can define "when the server is up again"? 

    Thursday, April 10, 2014 8:17 AM

Answers

  • Hi Janan,

    the only way to do this is by creating a master list containing all services you consider defining and then check for each of those services:

    • If it doesn't exist, that's ok
    • If it exists and is running, that's ok
    • If it exists and isn't running yet, the server isn't fully rebooted yet.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Thursday, April 10, 2014 10:07 AM

All replies

  • Hi Janan,

    the only way to do this is by creating a master list containing all services you consider defining and then check for each of those services:

    • If it doesn't exist, that's ok
    • If it exists and is running, that's ok
    • If it exists and isn't running yet, the server isn't fully rebooted yet.

    Cheers,
    Fred


    There's no place like 127.0.0.1

    Thursday, April 10, 2014 10:07 AM
  • Hello !

    I'm trying to create a Reboot script, but I have a question about, how I can define, when the server it's up again. 

    What I mean about "when the server is up", in example; If I have a DC to reboot first, then I need a service or another option, that I can use to define the server it's up again, so the script can go to the next server on the list, but the twist is that I am looking for a service that can be used  to define "all" kind of servers (SQL, DC, File, NAV, Axapta, ect.)

    Do someone have a good idea how i can define "when the server is up again"? 

    PowerShell has that built into its CmdLet:

    Restart-Computer -cn pc01 -wait

    HELP Restart-Computer -FULL

    This waits until the computer is up by testing various aspects to the computer for readiness.

    One other reason to abandon batch files and VBScript.


    ¯\_(ツ)_/¯

    Thursday, April 10, 2014 2:11 PM
  • Hi Fred,

    I was thinking the same, but I hoped I could find an easier way to do it, but I will try to define some services for each type of servers.

    Thank you for the anwser ! ✌


    Friday, April 11, 2014 10:15 AM
  • Hi Fred,

    I was thinking the same, but I hoped I could find an easier way to do it, but I will try to define some services for each type of servers.

    Thank you for the anwser ! ✌


    This was made for that:

    Restart-Computer -cn pc01 -wait

    HELP Restart-Computer -FULL


    ¯\_(ツ)_/¯

    Friday, April 11, 2014 10:17 AM