A one-line reachability test against a public address, written to fail the run when the host has no way out. Small enough to be worth reading as an example of the ServerEngine logging convention, and useful as the first step of any runbook that downloads something.
powershell
# Check Internet Connection
#-----------------------------------------
$internet = (Test-Connection 8.8.8.8 -Count 1 -Quiet -ErrorAction SilentlyContinue)
if ($internet) {
Write-Host "<WRITE-LOG = ""*Internet connection: Available*"">"
}
else{
Write-Error "Internet connection: Unavailable"
}Run it across your fleet
This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.
More in Checks & Diagnostics
Ready when you are.
Try ServerEngine free for 7 days.