Testing Network Connections (Part 1)

by Jan 9, 2020

PowerShell comes with Test-NetConnection which works like a sophisticated ping tool. In its default, you can ping computers:

 
PS> Test-NetConnection -ComputerName powershell.one 


ComputerName           : powershell.one
RemoteAddress          : 104.18.46.88
InterfaceAlias         : Ethernet 4
SourceAddress          : 192.168.2.108
PingSucceeded          : True
PingReplyDetails (RTT) : 26 ms  
 

Using -TraceRoute, it includes a route tracing, listing all the network nodes used to travel to the target:

 
PS> Test-NetConnection -ComputerName powershell.one -TraceRoute


ComputerName           : powershell.one
RemoteAddress          : 104.18.46.88
InterfaceAlias         : Ethernet 4
SourceAddress          : 192.168.2.108
PingSucceeded          : True
PingReplyDetails (RTT) : 25 ms
TraceRoute             : 192.168.2.1
                         62.155.243.83
                         62.154.2.185
                         62.157.250.38
                         195.22.215.192
                         195.22.215.59
                         104.18.46.88 
 

Twitter This Tip! ReTweet this Tip!