Network Connectivity Test
Category: Network Troubleshooting
Pings the default gateway, DNS server, and public internet to determine where network failure may be occurring.
$gateway = (Get-NetRoute -DestinationPrefix "0.0.0.0/0").NextHop
$dns = (Get-DnsClientServerAddress -AddressFamily IPv4).ServerAddresses | Select-Object -First 1
Write-Host "`nPinging Default Gateway ($gateway)..." -ForegroundColor Cyan
Test-Connection -ComputerName $gateway -Count 4
Write-Host "`nPinging DNS Server ($dns)..." -ForegroundColor Cyan
Test-Connection -ComputerName $dns -Count 4
Write-Host "`nPinging Internet (8.8.8.8)..." -ForegroundColor Cyan
Test-Connection -ComputerName 8.8.8.8 -Count 4
Write-Host "`nPinging Internet (google.com)..." -ForegroundColor Cyan
Test-Connection -ComputerName google.com -Count 4
Comments
Log in to leave a comment.