You can check TCP/IP level communication between two hosts by using Test-NetConnection command.
1. Operating System Support
- Server OS: Windows Server 2012 R2 and later
- Client OS: Windows 8.1 and later
2. Syntax
Open PowerShell and run Test-NetConnection command.
Examples
Example. 1
To check if the port 443 of this site en.win2012r2.com is open or not…
PS> Test-NetConnection en.win2012r2.com -port 443 ComputerName : win2012r2.com
RemoteAddress : 49.212.180.105
RemotePort : 443
InterfaceAlias : Ethernet
SourceAddress : 192.168.1.7
TcpTestSucceeded : True
The client can communicate with 443 port of en.win2012r2.com because the result of TcpTestSucceeded is True.
Example. 2
To check if the port 23 of this site en.win2012r2.com is open or not…
PS> Test-NetConnection en.win2012r2.com -port 23
WARNING: TCP connect to (49.212.180.105 : 23) failed
ComputerName : win2012r2.com
RemoteAddress : 49.212.180.105
RemotePort : 23
InterfaceAlias : Ethernet
SourceAddress : 192.168.1.7
PingSucceeded : True
PingReplyDetails (RTT) : 10 ms
TcpTestSucceeded : False
The client cannot communicate with 23 port of en.win2012r2.com because the result of TcpTestSucceeded is false. However communication using ICMP is successful because ping PingSucceded is True.
Comments