SID-500

Home » PowerShell » PowerShell: Playing with Test-NetConnection (ping, tracert, TCP Ports …)

PowerShell: Playing with Test-NetConnection (ping, tracert, TCP Ports …)

The more I am playing with it, the more I like it: Test-NetConnection. Test-NetConnection views information of a connection. What can we do with it?

Ping

If the computername was not specified, the default value is internetbeacon.msedge.net.

Test-NetConnection

1.PNG

Let´s specify an address for the remote host.

2.PNG

Happy to see, that sid-500.com is responding much faster than the beacon thing. 😉

Test HTTP Connections

Is it possbile to establish a connection to sid-500.com over HTTP?

Test-NetConnection www.sid-500.com -CommonTCPPort HTTP

1.PNG

Yes, it is. And what about HTTPS?

Test-NetConnection www.sid-500.com -Port 443

4.PNG

Test RDP Connections

Well, my blog is working. Hopefully my blog cannot be reached via Remote Desktop (RDP). Good to see that it is not so.

Test-NetConnection www.sid-500.com -CommonTCPPort RDP

5.PNG

Running Test-Connection with tracert / traceroute

Traceroute traces the route of packets to a destination host. You can do the same with Test-NetConnection.

Test-NetConnection www.sid-500.com -TraceRoute

6.PNG

Running in Quiet Mode

Be Quiet. Show me only whether the host is reachable or not.

Test-NetConnection www.sid-500.com -InformationLevel Quiet

7.PNG

Running in Detailed Mode

To get more out of Test-Connection run it in Detailed Mode. Pay attention to the additional information about DNS Name Resolution and the Next Hop Address.

Test-NetConnection www.sid-500.com -InformationLevel Detailed

8.png

Conclusion

Hope this ist helpful. The “smaller” version is Test-Connection: The modern version of ping: Test-Connection.


2 Comments

  1. […] See also my articles about Test-Connection and Test-NetConnection: The modern version of ping: Test-Connection and PowerShell: Playing with Test-NetConnection (ping, tracert, TCP Ports …) […]

    Like

  2. […] Test-Connection tests the connectivity to a remote host. See also my blog post about Test-NetConnection: PowerShell: Playing with Test-NetConnection (ping, tracert, TCP Ports …) […]

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

Who is the blogger?

My name is Patrick Grünauer (pewa2303). I am from Austria. On sid-500 I write about Windows, Cisco and IT-Security in English and German. Have fun while reading!

Patrick Gruenauer
Follow SID-500 on WordPress.com