Short answer Test the service’s TCP port instead of relying on ping.
When to use it
When the host answers ping but the application is unreachable.
Single port
Test-NetConnection <SERVER> -Port 443 -InformationLevel DetailedNote
Read TcpTestSucceeded.
Several ports
80,443,3389 | ForEach-Object {Test-NetConnection <SERVER> -Port $_ -WarningAction SilentlyContinue | Select-Object ComputerName,RemotePort,TcpTestSucceeded}Note
Test only ports that are relevant.
Caution
This does not validate UDP, and an open port does not prove application health.