{"id":3767,"date":"2026-11-18T15:30:00","date_gmt":"2026-11-18T15:30:00","guid":{"rendered":"https:\/\/vpslake.com\/blog\/?p=3767"},"modified":"2026-11-18T15:30:00","modified_gmt":"2026-11-18T15:30:00","slug":"check-if-port-is-open-tnc","status":"publish","type":"post","link":"https:\/\/vpslake.com\/blog\/2026\/11\/18\/check-if-port-is-open-tnc\/","title":{"rendered":"tnc command: Check if a Port Is Open on Windows"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">The <strong>tnc command<\/strong> is the quickest built-in PowerShell way to check whether a remote TCP port accepts connections from your Windows computer. You can use it for RDP port 3389, HTTPS port 443, SSH, a custom application port, or any other TCP service without installing a port-checking app.<\/p>\n\n\n\n<aside class=\"ap-card\" aria-label=\"Buffalo Windows RDP 4 GB (Basic KVM 4)\">\n<span class=\"ap-card__badge\">Our pick<\/span>\n<div class=\"ap-card__body\"><p class=\"ap-card__name\">Buffalo Windows RDP 4 GB (Basic KVM 4)<\/p><p class=\"ap-card__best\">Best for one browser profile, MT4\/MT5 EA, rater work, Google Ads account<\/p><ul class=\"ap-card__features\"><li>3 vCPU Intel Xeon E5-2699 v4, 4 GB reserved RAM<\/li><li>60 GB SSD (RAID 1), 3 TB traffic on a 200 Mbps port<\/li><li>Full Administrator, private KVM VM, 1 dedicated US IPv4<\/li><li>Windows Server 2019, Windows 10 Pro or Windows 11 Pro image; bring your own licence<\/li><li>Browser console, reinstall, reboot from the client area<\/li><li>Pay by crypto (Cryptomus), UPI\/card (Razorpay, Cashfree) or card (Paddle)<\/li><\/ul><\/div>\n<div class=\"ap-card__side\"><p class=\"ap-card__price\">$9.99\/mo <small>USD monthly<\/small><\/p><a class=\"ap-card__btn\" href=\"https:\/\/my.vpslake.com\/index.php?rp=\/store\/buffalo-new-york-basic-kvm-windows-rdp\/basic-kvm-4-windows-rdp\">Order now \u2192<\/a><\/div>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">tnc in one line<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><code>tnc<\/code> is the short PowerShell alias for <code>Test-NetConnection<\/code>. When you include <code>-Port<\/code>, PowerShell attempts a TCP connection to the target hostname or IP address and reports the result in <code>TcpTestSucceeded<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The basic pattern is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName &lt;hostname-or-ip&gt; -Port &lt;port&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For example, to test a server&#8217;s HTTPS port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName example.com -Port 443<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Microsoft documents <code>Test-NetConnection<\/code> as a diagnostic cmdlet for ping tests, TCP tests, route tracing, and route-selection diagnostics. The <code>-Port<\/code> parameter specifically tests TCP connectivity to the remote computer, while <code>-InformationLevel Quiet<\/code> returns a simple Boolean result. <a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/module\/nettcpip\/test-netconnection?view=windowsserver2025-ps\" target=\"_blank\" rel=\"noopener\">Read the Microsoft reference for Test-NetConnection<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What you need before testing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You need three pieces of information:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>The destination hostname or IP address, such as <code>rdp.example.com<\/code> or <code>198.51.100.25<\/code>.<\/li>\n\n\n<li>The TCP port, such as <code>3389<\/code> for a normal RDP listener or <code>443<\/code> for HTTPS.<\/li>\n\n\n<li>A reason to expect a service there. A failed test does not tell you whether the service is stopped, the port is wrong, DNS is incorrect, or a firewall is filtering traffic.<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Run the command from the same type of network that the real client will use. A test from inside a private network can succeed while an internet test fails because perimeter rules and routing differ. Only test systems you own or administer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Test a standard port<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start with the fully named form so the purpose of each value is obvious.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName 203.0.113.25 -Port 3389<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Why: this checks whether your current computer can complete a TCP connection to port 3389 on the target.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like <code>TcpTestSucceeded : True<\/code>. If you are checking a Windows RDP server, that means the TCP path to the RDP listener is working from your test machine. It does not yet prove that the username, password, NLA settings, or the complete graphical RDP session will work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use a hostname instead:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName rdp.example.com -Port 3389<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the hostname test fails, repeat it with the server&#8217;s IP address. A successful IP test and a failed hostname test usually points to DNS or name-resolution trouble rather than a closed service port.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Test RDP and custom ports<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">For RDP&#8217;s default TCP port, PowerShell also supports the named common-port option:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName 203.0.113.25 -CommonTCPPort RDP<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The explicit <code>-Port 3389<\/code> form is easier to audit and is the better choice when a server uses a non-default RDP port. For example, if RDP listens on <code>3390<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName 203.0.113.25 -Port 3390<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The same pattern works for web applications, APIs, databases, and SSH:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName app.example.com -Port 8443\ntnc -ComputerName 203.0.113.25 -Port 22\ntnc -ComputerName db.example.com -Port 5432<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The port number is not a service guarantee. A TCP connection to 8443 tells you that something accepted the connection; it does not confirm that the application speaks HTTPS or that it is healthy after the handshake. Use an application-level request when you need to verify the protocol itself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For RDP troubleshooting, first check the port the server is actually configured to use. If you connect with a custom port, the RDP client should use the form <code>hostname:port<\/code> or <code>ip-address:port<\/code>. See <a href=\"https:\/\/vpslake.com\/blog\/2026\/03\/27\/how-to-access-rdp-with-a-custom-port-step-by-step-guide-for-secure-remote-access\/\">how to access RDP with a custom port<\/a> for the connection-side details.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Read the output correctly<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A normal detailed result can include fields similar to these:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ComputerName     : 203.0.113.25\nRemoteAddress    : 203.0.113.25\nRemotePort       : 3389\nInterfaceAlias   : Wi-Fi\nSourceAddress    : 192.0.2.10\nTcpTestSucceeded : True<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The important fields are:<\/p>\n\n\n\n<figure class=\"wp-block-table ap-table\"><table><thead><tr><th>Field<\/th><th>Meaning<\/th><\/tr><\/thead><tbody><tr><td><code>ComputerName<\/code><\/td><td>The hostname or address you supplied.<\/td><\/tr><tr><td><code>RemoteAddress<\/code><\/td><td>The address selected after DNS resolution.<\/td><\/tr><tr><td><code>RemotePort<\/code><\/td><td>The TCP port tested.<\/td><\/tr><tr><td><code>InterfaceAlias<\/code><\/td><td>The local network interface used for the route.<\/td><\/tr><tr><td><code>SourceAddress<\/code><\/td><td>The local address used for the connection.<\/td><\/tr><tr><td><code>PingSucceeded<\/code><\/td><td>Whether an ICMP echo reply was received, when a ping was attempted.<\/td><\/tr><tr><td><code>TcpTestSucceeded<\/code><\/td><td>Whether the TCP connection to the specified port succeeded.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Treat <code>TcpTestSucceeded<\/code> as the answer to the port question. <code>PingSucceeded : False<\/code> does not automatically mean the TCP port is closed; many servers and firewalls block ICMP while allowing TCP. Conversely, a successful ping only proves that the host answered ICMP, not that your application port is listening.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For scripts, request only the Boolean result:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName app.example.com -Port 443 -InformationLevel Quiet<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Expected output:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>True<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can store the result and branch on it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$portOpen = tnc -ComputerName app.example.com -Port 443 -InformationLevel Quiet\n\nif ($portOpen) {\n    'TCP port is reachable'\n} else {\n    'TCP port is not reachable'\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Use Linux and macOS equivalents<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On Linux and macOS, <code>nc<\/code> (netcat) is the simple equivalent for one TCP port. The exact flags can vary between netcat packages, but this common form works on many systems:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nc -vz -w 5 example.com 443<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Here, <code>-v<\/code> asks for verbose output, <code>-z<\/code> checks for a listening service without sending application data, and <code>-w 5<\/code> sets a five-second timeout on implementations that support it. On macOS, start with the shorter command if the installed version does not accept <code>-w<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nc -vz example.com 443<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A success message normally includes <code>succeeded<\/code> or <code>open<\/code>. A refusal usually means the host was reachable but no service accepted that port. A timeout often indicates filtering, a routing problem, or a host that did not respond. The <a href=\"https:\/\/man.openbsd.org\/nc\" target=\"_blank\" rel=\"noopener\">OpenBSD nc manual<\/a> documents <code>-z<\/code> for scanning without sending data and <code>-w<\/code> for connection timeouts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a more detailed scan, use Nmap if it is installed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nmap -Pn -p 3389 203.0.113.25<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>-p<\/code> limits the scan to the port you specify. <code>-Pn<\/code> skips host discovery, which is useful when ICMP echo requests are blocked. Nmap may report <code>open<\/code>, <code>closed<\/code>, or <code>filtered<\/code>: <code>open<\/code> means an application is accepting connections, <code>closed<\/code> means the host is reachable but no application is listening, and <code>filtered<\/code> means a filter prevents Nmap from determining the state. The <a href=\"https:\/\/nmap.org\/book\/man-port-scanning-basics.html\" target=\"_blank\" rel=\"noopener\">Nmap port-scanning reference<\/a> explains why results can differ depending on where the scan originates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">These commands test TCP. They do not prove that a UDP service is available. <code>Test-NetConnection -Port<\/code> is also a TCP test, so use a protocol-specific diagnostic when an application depends on UDP.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Check the server when the port is closed<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run the next checks on the server itself, preferably through a console or another management path if RDP is unavailable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, confirm that a process is listening on the expected port:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-NetTCPConnection -LocalPort 3389 -State Listen<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Success is a returned connection object showing a listening local endpoint. If there is no result, check the service or application configuration. For the Windows RDP service, you can check the service state with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-Service -Name TermService<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, inspect the relevant firewall rules without turning the firewall off:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-NetFirewallRule -DisplayGroup \"Remote Desktop\" |\n    Format-Table DisplayName, Enabled, Profile, Direction, Action<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a custom application port, inspect the rule created for that application or port and confirm that it applies to the active network profile. If a rule needs changing, restrict it to the required protocol, port, profile, and source networks. <a href=\"https:\/\/vpslake.com\/blog\/2026\/10\/10\/allow-port-firewall-windows-server-2019\/\">Allowing a port in Windows Server 2019 Firewall<\/a> covers the Windows-side rule workflow.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then test in layers:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Test <code>localhost<\/code> and the port on the server to confirm a local listener.<\/li>\n\n\n<li>Test the server&#8217;s private or public IP from a second machine.<\/li>\n\n\n<li>Test the hostname to separate DNS problems from network problems.<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If localhost succeeds but a remote test fails, investigate Windows Firewall, a cloud security rule, a router, or a provider-side network policy. If the IP works but the hostname fails, fix DNS or use the correct address. If every test fails, verify the port number and application listener before changing firewall rules.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify before you call the problem solved<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Repeat the test from the actual client network after each change:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tnc -ComputerName your-server.example.com -Port 3389 -InformationLevel Detailed<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Confirm the resolved <code>RemoteAddress<\/code> is the intended server and that <code>TcpTestSucceeded<\/code> is <code>True<\/code>. Then try the real application. A successful TCP check proves reachability to the port; it does not replace an application login or protocol test.<\/p>\n\n\n\n<aside class=\"ap-cta\" aria-label=\"Get a private Windows RDP\"><div class=\"ap-cta__content\"><p class=\"ap-cta__eyebrow\">Private Windows access<\/p><p class=\"ap-cta__title\">Get a private Windows RDP<\/p><p class=\"ap-cta__text\">Run your own Windows desktop on a private Buffalo KVM VM with full Administrator access.<\/p><\/div><a class=\"ap-cta__btn\" href=\"https:\/\/vpslake.com\/buy-buffalo-windows-rdp\">View Windows RDP plans<\/a><\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What is the tnc command in PowerShell?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>tnc<\/code> is the short alias for <code>Test-NetConnection<\/code>. Add <code>-Port<\/code> to test a remote TCP port, for example <code>tnc example.com -Port 443<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I check if RDP port 3389 is open?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Run <code>tnc -ComputerName &lt;server-ip&gt; -Port 3389<\/code> from the client computer. Read <code>TcpTestSucceeded<\/code>; <code>True<\/code> means the TCP connection reached the target port from that client, while <code>False<\/code> means you need to investigate the path, listener, or filtering.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why does tnc show ping succeeded but TCP failed?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ping and TCP use different protocols and can be treated differently by firewalls. A host can answer ICMP while blocking port 3389, or it can allow TCP while blocking ping, so use <code>TcpTestSucceeded<\/code> for the port result.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can tnc test UDP ports?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. The <code>-Port<\/code> parameter tests TCP. Use an application-specific UDP check or a tool designed for the service when UDP matters.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is a closed port always a firewall problem?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. A stopped service, wrong port number, DNS error, route problem, or firewall can all produce a failed connection. Check for a local listener first, then test the firewall and network path from the client side.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DONE check-if-port-is-open-tnc words=1445<\/p>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"What is the tnc command in PowerShell?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"tnc is the short alias for Test-NetConnection. Add -Port to test a remote TCP port, for example tnc example.com -Port 443.\"}}, {\"@type\": \"Question\", \"name\": \"How do I check if RDP port 3389 is open?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Run tnc -ComputerName &lt;server-ip&gt; -Port 3389 from the client computer. Read TcpTestSucceeded; True means the TCP connection reached the target port from that client, while False means you need to investigate the path, listener, or filtering.\"}}, {\"@type\": \"Question\", \"name\": \"Why does tnc show ping succeeded but TCP failed?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Ping and TCP use different protocols and can be treated differently by firewalls. A host can answer ICMP while blocking port 3389, or it can allow TCP while blocking ping, so use TcpTestSucceeded for the port result.\"}}, {\"@type\": \"Question\", \"name\": \"Can tnc test UDP ports?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. The -Port parameter tests TCP. Use an application-specific UDP check or a tool designed for the service when UDP matters.\"}}, {\"@type\": \"Question\", \"name\": \"Is a closed port always a firewall problem?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. A stopped service, wrong port number, DNS error, route problem, or firewall can all produce a failed connection. Check for a local listener first, then test the firewall and network path from the client side. DONE check-if-port-is-open-tnc words=1445\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Use the tnc command in PowerShell to check any TCP port on Windows, understand TcpTestSucceeded, and troubleshoot closed RDP, HTTPS, and custom ports.","protected":false},"author":1,"featured_media":3768,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[13],"tags":[876,38,866,875,42],"class_list":["post-3767","post","type-post","status-publish","format-standard","has-post-thumbnail","category-server-security","tag-port-check","tag-powershell","tag-rdp-troubleshooting","tag-tnc-command","tag-windows-server","cs-entry"],"_links":{"self":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/3767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/comments?post=3767"}],"version-history":[{"count":1,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/3767\/revisions"}],"predecessor-version":[{"id":4096,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/posts\/3767\/revisions\/4096"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media\/3768"}],"wp:attachment":[{"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/media?parent=3767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/categories?post=3767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vpslake.com\/blog\/wp-json\/wp\/v2\/tags?post=3767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}