One of the Cmdlet that I use often at work lately is Test-NetConnection. This one is good for your sanity check when you want your server to start to communicate with different endpoints. It supports ping test, TCP test, route tracing, and route selection diagnostics. 

$ Test-NetConnection -ComputerName google.com
ComputerName           : google.com
RemoteAddress          :
InterfaceAlias         : Ethernet
SourceAddress          :
PingSucceeded          : True
PingReplyDetails (RTT) : 14 ms

If you want to check if certain port is open, you can add -Port parameter to the command above and it checks the specified port.

$ Test-NetConnection -ComputerName google.com -Port 80
ComputerName     : google.com
RemoteAddress    :
RemotePort       : 80
InterfaceAlias   : Ethernet
SourceAddress    :
TcpTestSucceeded : True

Notice that TcpTestSucceeded data is True now. It means the current machine can reach the port 80 of the endpoint.

Leave a Reply

Your email address will not be published.