Saturday, August 12, 2017

PowerShell Check if Server is alive

Use the script below to check if a server is alive # replace the server name to make it fit into your needs.

$server = “”

If (Test-Connection $server -count 1 -quiet) {
  Write-host  “The $server responded” -f yellow

Write-host  “No connection to $server -f red
  Write-host “Script will stop” -f red

Oz Casey, Dedeal
Systems Engineer (Blog) (Blog) (Twitter)

No comments: