PowerShell script to check TCP port status

Posted on 10 October 2018

Below script to check tcp port is open for remote server as well as local machine

new-object system.net.sockets.tcpclient("",9090)

IP Address: TCP IP port: 9090

If port is closed, the script will throw error "No connection could be made because the target machine actively refused it"


Leave Comment below.