Hello
I need to access a LAN computer via RDP, and need to know on which port that computer is listening. how can I proceed with this?

Also is there a generic freeware which can allow me to scan all pcs on my LAN and get me a list of all open ports on those pcs?

Dani AI

Generated

Quick, practical steps to find which port Remote Desktop is listening on and how to scan a LAN for open ports. Default RDP uses TCP port 3389, but admins often change it. As pointed out, using a network scanner is useful; pair that with simple host-side checks for a definitive answer.

On the target Windows machine (best when local admin access is available): check the registry value that controls RDP port and list listening sockets to map port → PID → process. Example commands that work from an elevated prompt:

reg query "HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber
netstat -ano | findstr LISTENING
tasklist /FI "PID eq 1234"

On newer Windows versions PowerShell can be used to list listening ports and test specific ports:

Get-NetTCPConnection -State Listen
# Test a specific host/port:
Test-NetConnection -ComputerName 192.168.1.45 -Port 3389

When scanning multiple LAN hosts, use a lightweight scanner or a short PowerShell loop to test a single port across an address range (safer than wide port sweeps). Example scan for RDP on a /24:

1..254 | ForEach-Object {
  $ip = "192.168.1.$_"
  $r = Test-NetConnection -ComputerName $ip -Port 3389 -WarningAction SilentlyContinue
  if ($r.TcpTestSucceeded) { "$ip : RDP open" }
}

Common pitfalls and troubleshooting: host firewalls can hide open ports (showing as filtered), RDP must be enabled in System Properties and the Remote Desktop Services should be running, and registry changes require a service restart or reboot. If the target is behind NAT, confirm router port-forwarding or use a VPN instead of exposing ports. Scanning can trigger alerts—perform scans only with authorization.

Recommended Answers

All 2 Replies

NMAP SCanner is what I use. ZenMap GUI can be used as a front end if you don't like command line.

thanks great tool ;)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.