Guide

How to test a TCP port with PowerShell

Test-NetConnection allows you to quickly check if a station can reach a server on a specific TCP port, without installing any additional tool.

⌚ About 2 min read
View my favorites
Windows / Network Beginner 5 min

Test-NetConnection allows you to quickly check if a station can reach a server on a specific TIP port, without installing any additional tool.

Avant de commencer : adaptez toujours les commandes et manipulations à votre environnement. Sur un système de production, prévoyez une backup ou un retour arrière lorsque l’action peut modifier la configuration.

Étapes à suivre

  1. 1

    Open Power Shell

    Launch Power Shell on the station from which you want to test the feed.

  2. 2

    Select Target

    Use the FQDN or l, IP address actually used by the application.

  3. 3

    Test port

    Run Test-Net-Maripolina with the port and raise Tcp TetSu Ticled.

  4. 4

    Compare DNS

    If FQDN fails but the IP works, control DNS resolution.

  5. 5

    Document Result

    Keep in mind the time, source, destination, port and result for the diagnosis of the Fire.

Commands utiles

Test-Net-Gonneur server.example.local -Port 443
Test-Net-Gonnegion 192.168.1.10 -Port 445

À retenir

  • A closed port and a timeout do not necessarily mean the same cause.
  • The test confirms the connectivity of the port, not the proper functioning of the application.
  • Test from the real user network when the problem depends on, a VLAN or VPN
Technical deep dive

TCP port: distinguish local listening from network reachability

Technical checkpoints

  • A LISTENING socket only proves that a process is listening locally; it does not prove remote reachability.
  • Test-NetConnection tests the path to the host and port; interpret it together with DNS, routing and firewall state.
  • 0.0.0.0:port listens on all IPv4 interfaces, while 127.0.0.1:port remains local to the machine.

Cross-check

Compare the local socket with a test from a host located on the actual path.

Get-NetTCPConnection -State Listen
Test-NetConnection server -Port 443

Topic-specific pitfalls

  • A successful ping does not validate a TCP port.
  • A remote failure can come from an intermediate firewall even when the service listens correctly.

How to validate

  • The expected PID/process listens on the correct local address.
  • The port is tested from at least one representative source and matches firewall policy.
♡ 0