powershell loop to continous check if server is up

Question:

I want to run a script to check if 5 servers are up and running based on a specific service is running.If that service is running then we know that server is up and accesible. If it does not reply with a response back then I want it to continously check for it. Heres what I got so far:

Answer:

Yep you just need to check the Status property on the returned object like this:


Update Here is an example of how to wait for a server to become online:

Source:

powershell loop to continous check if server is up by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply