Users: 30k; Pages Per Session: 2.5p; Avg. Session Duration: 1:35mi
TechDevOps.com
Explore Tools
{Featuring Microsoft Technologies + Enterprise Data + Cloud Computing}



Verify a remote TCP port connectivity using Powershell
by BF (Senior MSSQL Operations - Enterprise, Cloud, Strategy)
2016-12-10








If you are required to test whether a remote TCP port is accessible or not and you do not have Telnet configured, let
Powershell step in to do the job.


As Per MSDN:

"Test-NetConnection
Displays diagnostic information for a connection.

Detailed Description
The Test-NetConnection cmdlet displays diagnostic information for a connection. It supports ping test, TCP test, route tracing, and route selection diagnostics. Depending on the input parameters, the output can include the DNS lookup results, a list of IP interfaces, IPsec rules, route/source address selection results, and/or confirmation of connection establishment."



Powershell Cmdlet:

Test-NetConnection -computername sqlxyz -port 1433









If you are getting a Ping failed result, ensure to check Windows Firewall: Inbound Rules: ...Echo Request - ICMP... is enabled. (Ping software utility operates by sending Internet Control Message Protocol (ICMP) Echo Request packets to the target host and waiting for an ICMP Echo Reply)


Resources:

Test-NetConnection