Network Connection Monitor
This PowerShell script is designed to monitor the status of network connections on your system. Regular monitoring is critical for maintaining network health, especially when using advanced server management tools like ServerEngine. The script checks whether specific network resources are reachable, enabling administrators to detect and address connectivity issues proactively.
param ( [string[]]$targets = @("www.google.com", "www.example.com"), [int]$checkInterval = 60 ) while ($true) { foreach ($target in $targets) { try { $pingResult = Test-Connection -ComputerName $target -Count 2 -ErrorAction Stop Write-Output "$target is reachable." } catch { Write-Output "$target is not reachable." } } Start-Sleep -Seconds $checkInterval }