← script library

Check Active Network Connections

NetworkingJanuary 11, 2025

This PowerShell script identifies active network connections on your system, helping you to monitor potentially insecure connections. It's a valuable tool for assessing your network security posture.

powershell
$activeConnections = Get-NetTCPConnection | Where-Object { $_.State -eq 'Established' }

$activeConnections | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State | Format-Table -AutoSize

$activeConnections | Select-Object LocalAddress, LocalPort, RemoteAddress, RemotePort, State | Export-Csv -Path "ActiveConnections.csv" -NoTypeInformation

Run it across your fleet

This script runs as-is on a single host. Paste it into ServerEngine to schedule it, run it on a whole server group in parallel, and keep the credentials out of the file — see the scripts documentation and the credential store.

Ready when you are.

Try ServerEngine free for 7 days.