Powershell: Open TCP listener port

Bschelst/ January 5, 2017/ PowerShell/ 0 comments

If you want to test a firewall rule, while the application isn’t ready yet, you can start that port on the Windows server using Powershell.
This way you can test the firewall functionality.
Those actions can be done with the following commands:

$Listener = [System.Net.Sockets.TcpListener]4444; $Listener.Start(); 

Where “4444” is the TCP port that you want to open.
Once ready, you need to stop the listener again. You can use the following command for this:




Share this Post

Leave a Comment

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