Powershell - Testing network connectivity and port accessibility
To support me, you can subscribe to the channel, share and like the videos, disable your ad blocker or make a donation. Thank you!
Hello, A new article with Powershell commands for testing network connectivity (equivalent to ping) and port access (which can also be done with telnet, but this command is no longer available natively).
# Check network connectivityTest-connection -ComputerName www.google.com
# Set number of pings (default 4)Test-connection -ComputerName www.google.com -Count 1
# Only return a boolean valueTest-connection -ComputerName www.google.com -Quiet
# Ask other stations to ping the destination# Eliminates the need to connect to remote computers to start pinging, allowing you to test from other sources# Requires WinRM to be configured on remote hosts and an account authorized to use WinRMTest-connection -ComputerName www.google.com -Source PC-1,PC-2# Or by providing credentialsTest-connection -ComputerName www.google.com -Source PC-1,PC-2 -Credential (Get-Credential)
# Test accessibility of common ports (SMB, HTTP, RDP, ping)Test-NetConnection -ComputerName www.google.com -CommonTCPPort HTTP
# Display more informationTest-NetConnection -ComputerName www.google.com -CommonTCPPort HTTP -InformationLevel Detailed
# Only return a Boolean valueTest-NetConnection -ComputerName www.google.com -CommonTCPPort HTTP -InformationLevel quiet
# Test port accessibility (you can also use the -InformationLevel parameter)Test-NetConnection -ComputerName www.google.com -Port 443
Related links
Powershell - Testing network connectivity and port accessibility
Testing network connectivity and port accessibility with PowershellPowershell - Display network connections (equivalent to netstat)
Display network connections (listening ports, active connections...)Powershell - Testing name resolution (equivalent to nslookup)
Powershell commands to test name resolution (equivalent to nslookup)Powershell - View and manage DNS configuration of network interfaces
Powershell commands to display and manage DNS configuration of network interfacesPowershell - Managing IP configuration of network interfaces
Powershell commands to view and modify the IP configuration of network interfacesPowershell - Managing the status and configuration of network interfaces
Powershell commands to view and modify the status and configuration of network interfaces (disable IPv6, enable/disable an interface)
Follow me on
Support me
Last content
Powershell - Testing network connectivity and port accessibility
Powershell - Display network connections (equivalent to netstat)
Powershell - Testing name resolution (equivalent to nslookup)
Powershell - View and manage DNS configuration of network interfaces
Powershell - Managing IP configuration of network interfaces
Powershell - Managing the status and configuration of network interfaces
Powershell and the Left Hand Side
Powershell - Managing disks, partitions and volumes