Close Menu
    What's Hot

    Test-NetConnection in PowerShell: Ports, Ping, Routes

    November 24, 2026

    Increase Mailbox Size in Exchange Server SE, 2019 and 2016

    November 23, 2026

    Games Like Overwatch: 8 Shooters Worth Playing Now

    November 22, 2026
    Facebook X (Twitter) YouTube LinkedIn
    Facebook X (Twitter) YouTube LinkedIn
    SysprobsSysprobs
    • Tech Guides
      • Windows
        • Windows 11
        • Windows 10
        • Windows Servers
      • Virtualization
        • VirtualBox
        • VMware
        • Hyper-V
        • Server Virtualization
        • VirtualBox Images
      • PC
        • Linux
        • macOS
        • Hackintosh
        • MS Office
      • Pro IT Tips
        • Internet
        • MS Exchange
        • Fintech
    • Reviews
      • Gadgets
        • Android
        • iPhone
    • Security & Privacy
      • IT Security
    • Data
      • Calculators and tools
      • Statistics
      • Reference tables
    SysprobsSysprobs
    Home»Featured»Test-NetConnection in PowerShell: Ports, Ping, Routes

    Test-NetConnection in PowerShell: Ports, Ping, Routes

    DineshBy Dinesh
    Share
    Facebook Twitter LinkedIn Pinterest Email

    If a user says “the app cannot reach the server”, the first thing I run is test-netconnection. It pings the host, tests a TCP port and traces the route from one built-in PowerShell cmdlet, so there is nothing to install on Windows 10/11 or Windows Server.

    In this guide, I’ll show the commands I use most, what the output means, and where the cmdlet falls short.

    Quick answer: run Test-NetConnection -ComputerName server01 -Port 443. If TcpTestSucceeded says True, the port is open from your machine to that server. If it says False, something between you and the server (firewall, routing, or the service itself) is blocking it.

    Powershell Network Testing Guide

    Ping a Host First

    Run it with only a computer name or IP and it does an ICMP ping.

    Test-NetConnection -ComputerName 192.168.1.10

    You get the remote address, the interface it used, the source address and PingSucceeded, with the round trip time. It is built in, so it works on a locked-down server where you cannot install anything.

    Test-NetConnection -ComputerName

    A failed ping does not always mean the host is down. Many Windows machines block ICMP by default. If you are testing a Windows PC, check this first: enable ping reply in Windows. Then test a real port instead of relying on ping alone.

    Test a TCP Port from the Command Line

    This is the reason most people search for the command. Add -Port:

    Test-NetConnection -ComputerName mail.contoso.com -Port 25

    Look at TcpTestSucceeded. True means the TCP handshake completed. It does not prove the application behind the port is healthy, only that the connection opens.

    port 25 check and confirm

    For the common services you can skip the port number. -CommonTCPPort accepts SMB, HTTP, RDP and WINRM, as Microsoft documents:

    Test-NetConnection -ComputerName fileserver01 -CommonTCPPort SMB
    Test-NetConnection -ComputerName server01 -CommonTCPPort RDP

    This replaces the old habit of using Telnet to check a port. If you still need it, here is how to enable Telnet, but I rarely bother now.

    SMB Check

    Obviously, if you have any firewall in between, these ports should be opened in your traffic flow.

    When TcpTestSucceeded is False

    Check these in order, because the cause is usually one of them:

    1) The Windows Firewall on the server has no inbound rule for that port. 2) A network firewall or ACL between the two subnets drops it. 3) The service is stopped, or it listens on a different port. 4) You typed the wrong name or IP, so the name resolved to the wrong host.

    The output also prints PingSucceeded for the same host. If ping works and the port fails, the path is fine and the problem is at the port. If both fail, think routing or a firewall that blocks everything.

    Trace the Route and Diagnose Routing

    Add -TraceRoute for a tracert style result, and -Hops to limit how far it goes:

    Test-NetConnection -ComputerName 8.8.8.8 -TraceRoute -Hops 15

    The command output lists each hop in TraceRoute. A hop that times out in the middle is normal on many networks, since routers often do not answer. What matters is whether the trace reaches the last hop.

    There is also -DiagnoseRouting, which shows how Windows picks the route and source address. You can limit it with -ConstrainSourceAddress or -ConstrainInterface. I would use it on a server with several NICs, where traffic leaves from the wrong interface.

    Use Quiet Output in Scripts

    By default you get an object with many properties. For scripts, -InformationLevel Quiet returns only True or False:

    if (Test-NetConnection -ComputerName server01 -Port 443 -InformationLevel Quiet) {
        "Port 443 is open"
    } else {
        "Port 443 is blocked"
    }

    To check many servers, loop over a list:

    "server01","server02","server03" | ForEach-Object {
        [pscustomobject]@{
            Server = $_
            Port443 = Test-NetConnection $_ -Port 443 -InformationLevel Quiet
        }
    }

    Each failed test waits for the timeout, so a long list with dead hosts takes a while. For plain ping across many addresses, pinging multiple IP addresses is faster.

    These types of scripts help a lot in a work environment when you manage multiple servers, for example, after a major firewall update with changes in the policies, or any system updates that closed certain SMB or RDP ports, etc

    Test-Connection vs Test-NetConnection

    The difference is simple: Test-Connection is the plain ping cmdlet. In PowerShell 7, Test-Connection also has a -TcpPort option, so it can test a port too. The older cmdlet is still the one to use on Windows PowerShell 5.1, where it is installed by default.

    Not sure which version you run? See which PowerShell version you have.

    Does PowerShell Test UDP Ports?

    Not as far as Microsoft documents it for this cmdlet. The parameters only cover ICMP ping, TCP ports, route tracing and routing diagnostics. If you need to test UDP (DNS on 53 or NTP on 123 for example), you need another tool or a custom script, because a UDP “open” result is not reliable without a reply from the service.

    Fix: Cmdlet Not Recognized

    The cmdlet comes from the NetTCPIP module, which is part of Windows. If you get “not recognized”, you are most likely on a very old Windows version, or in a PowerShell session on Linux or macOS where that module does not exist. Open Windows PowerShell on a current Windows machine, or use Test-Connection with -TcpPort in PowerShell 7.

    Networking PowerShell Troubleshooting
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Dinesh
    • Website

    Dinesh is the founder of Sysprobs and written more than 400 articles. Enthusiast in Microsoft and cloud technologies with more than 15 years of IT experience.

    Related Posts

    Increase Mailbox Size in Exchange Server SE, 2019 and 2016

    November 23, 2026

    Games Like Overwatch: 8 Shooters Worth Playing Now

    November 22, 2026

    Ubiquiti Device Discovery Tool for Finding UniFi Gear on a Windows Desktop

    November 22, 2026

    Microsoft Purview Compliance Portal Tutorial for Admins

    November 17, 2026

    The Cost Of Open Source Icon Debt Before Series A

    November 17, 2026

    Fedora vs Arch Linux: Which Distro Should You Pick?

    November 13, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Where is the Outlook QR code? How to Use?

    February 16, 2024

    How to Install and Use Outlook for Ubuntu 24.04 LTS/24.10

    December 10, 2025

    Download and Use Windows 7 Pre-Installed VirtualBox Image

    May 3, 2022
    Don't Miss

    Test-NetConnection in PowerShell: Ports, Ping, Routes

    November 24, 2026

    If a user says “the app cannot reach the server”, the first thing I run…

    Increase Mailbox Size in Exchange Server SE, 2019 and 2016

    November 23, 2026

    Games Like Overwatch: 8 Shooters Worth Playing Now

    November 22, 2026

    Ubiquiti Device Discovery Tool for Finding UniFi Gear on a Windows Desktop

    November 22, 2026
    Stay In Touch
    • Facebook
    • YouTube
    • Twitter
    • LinkedIn
    Latest Posts

    Test-NetConnection in PowerShell: Ports, Ping, Routes

    November 24, 2026

    Increase Mailbox Size in Exchange Server SE, 2019 and 2016

    November 23, 2026

    Games Like Overwatch: 8 Shooters Worth Playing Now

    November 22, 2026
    300x250 001 English PCRepairKit Yakusheva
    UP NEXT FOR YOU
    • Increase Mailbox Size in Exchange Server SE, 2019 and 2016
    • Overwatch 2 AlternativesGames Like Overwatch: 8 Shooters Worth Playing Now
    • Device Discovery ToolUbiquiti Device Discovery Tool for Finding UniFi Gear on a Windows Desktop

    INFORMATION
    • About
    • Contact Us
    • Privacy Policy
    ABOUT

    Established in 2007, Sysprobs is a trusted resource for IT professionals and system administrators. We publish practical, battle-tested guides for the people who run Microsoft infrastructure — Windows, Windows Server, Active Directory, Entra ID, Intune, Exchange, and virtualization. Real fixes for real production problems, written by people who've actually hit them.

    POPULAR SECTION

    WINDOWS 11
    WINDOWS 10
    VIRTUALIZATION
    IT SECURITY
    PRO IT TIPS

     

    Information
    • About
    • Contact Us
    • Homepage
    • Privacy Policy
    Sysprobs
    Facebook X (Twitter) YouTube LinkedIn
    • Home
    • Windows
    • Cloud
    • Security & Privacy
    © 2026 SYSPROBS: System Security & Fintech Solutions. Protected by Cloudflare.

    Type above and press Enter to search. Press Esc to cancel.