Categories
Tech

Windows 2012 R2 Super Ping

Test-NetConnection PowerShell Portscan

SUPERPING – POWERSHELL TEST-NETCONNECTION

POSTED IN CLOUDITMICROSOFTPOWERSHELLPRIVATE CLOUDVIRTUALIZATIONWINDOWSWINDOWS 8.1WINDOWS SERVERWINDOWS SERVER 2012 R2WORK
inShare1

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 ;-)

1
Test-NetConnection thomasmaurer.ch -CommonTCPPort RDP

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.

1
Test-NetConnection thomasmaurer.ch -TraceRoute

Test-NetConnection PowerShell Traceroute

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

1
while ($true) {Test-NetConnection -InformationLevel Quiet}

Ping -t with PowerShell

I hope this helps you a little :)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.