Friday, December 14, 2012

Checking if a TCP port is listening in PowerShell (TCP Ping)

In older versions of Windows, the telnet command could be used to test a TCP connection to another machine. However, this is not installed by default on newer versions of the O/S. The solution is to use a .NET class from PowerShell:
New-Object System.Net.Sockets.TcpClient machinename, 1337


Post a Comment