Test-NetConnection PowerShell Portscan

SuperPing – PowerShell Test-NetConnection

With Windows 8.1 and Windows Server 2012 R2 Microsoft released PowerShell v4 with new PowerShell modules and new PowerShell cmdlets. One of them is the new Test-NetConnection cmdlet which does basically replaces some simple network tools like Ping, Traceroute, Portscanner and more.

First if you just run Test-NetConnection this will check a Microsoft edge server and will tell you if your internet is working or not.

PowerShell Test-NetConnection

You can also ping other servers

Test-NetConnection Ping

If we have a closer look at this cmdlet we can see that we can do much more.

get-help get-testnetconnection

What we can do is something like a port scan. In this example I check if the RDP port is open on my webserver. Which is hopefully not 😉

Test-NetConnection PowerShell Portscan

You can also check for not so common ports by using the -Port parameter and entering the port number.
Another thing you could do would be a simple traceroute.

Test-NetConnection PowerShell Traceroute

If you want to do a ping -t you could use the following command

Ping -t with PowerShell

I hope this helps you a little 🙂