> ## Content Index
> Fetch the complete content index at: https://www.filipkonopik.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# PowerShell: Get Open Ports
- URL: https://www.filipkonopik.com/powershell-get-open-ports/
- Published: 2026-07-27T11:06:33.000Z
- Updated: 2026-08-06T05:45:52.000Z
- Author: Filip Konopík
- Tags: Connectivity

Need to check which ports are open and listening for incoming connections - for security auditing or troubleshooting a network service? This one-liner pulls it straight from the system.

Prerequisites:

- Privileges: None
- Module: Built-in, no import needed

Quick Command:

```Powershell
Get-NetTCPConnection -State Listen | Select-Object LocalAddress, LocalPort, State
```

Example Output:

```powershell
LocalAddress  LocalPort  State
------------  ---------  -----
::                49664 Listen
127.0.0.1         49670 Listen
0.0.0.0             445 Listen
0.0.0.0             139 Listen
0.0.0.0             135 Listen
0.0.0.0           16992 Listen
0.0.0.0             623 Listen
```

📦

****Want all of them at once?**  
Get every free one-liner from this blog in a single downloadable bundle organized by category, each with full comment-based help. No more copy-pasting one at a time.

[Get the Complete Bundle for $39](https://gum.co/u/oczvkqdc?ref=filipkonopik.com)

How It Works:

- Get-NetTCPConnection returns every TCP connection the system has, in any state - established connections to websites, closing connections, and ports listening for incoming traffic, all mixed together.
- \-State Listen filters down to only ports actively listening for incoming connections - these are the genuinely "open" ports, as opposed to outbound connections to remote servers (which show as Established).
- LocalAddress of 0.0.0.0 or :: means the port is listening on all network interfaces; a specific IP (like 192.168.1.144) means it only accepts connections from that specific address.