IT Toolbox
Menu
PowerShell · Network

Test access to a TCP port with PowerShell

Checks whether a server responds on a specific TCP port and displays useful network information.

Low risk

Command

$Serveur = "serveur.exemple.fr" $Port = 443 Test-NetConnection -ComputerName $Serveur -Port $Port -InformationLevel Detailed

When to use it

Use this when an application, website, VPN, or remote service appears to be unreachable.

How it works

  • Replace the server name and port number with the target you want to test.
  • The TcpTestSucceeded property indicates whether the TCP connection succeeded.
  • The result also shows the resolved IP address and the network interface used.

Precautions

  • A failed test does not prove that the server is down: a firewall may be blocking the port.
  • Test from more than one workstation or network before drawing a conclusion.

Rollback

No rollback is required: this command does not modify the system.

Support the development of BAOI Hosting, domains and new IT resources.
❤️ Support BAOI