title: powershell loop to continous check if server is up
body: <p>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:</p>
  
  <pre><code>Get-Service LANMANSERVER -ComputerName JOHNJ1
  Get-Service LANMANSERVER -ComputerName JOHNJ2
  Get-Service LANMANSERVER -ComputerName JOHND1
  Get-Service LANMANSERVER -ComputerName JOHNM
  Get-Service LANMANSERVER -ComputerName JOHNI
  start-sleep 90
  </code></pre>