
In our previous article, Enable Telnet in Windows Operating System, we have shared with you the steps to activate the telnet functionality with the Windows command prompt. The telnet client feature is disabled by default – due to some security concerns.
Of course, there is an alternative, using the PowerShell.
Test-NetConnection
#Displays diagnostic information for a connection.
Syntax
Parameter Set: CommonTCPPort
Test-NetConnection [[-ComputerName] <String> ] [-CommonTCPPort] <String> [-InformationLevel <String> ] [ <CommonParameters>]
Parameter Set: ICMP
Test-NetConnection [[-ComputerName] <String> ] [-Hops <Int32> ] [-InformationLevel <String> ] [-TraceRoute] [ <CommonParameters>]
Parameter Set: RemotePort
Test-NetConnection [[-ComputerName] <String> ] -Port <Int32> [-InformationLevel <String> ] [ <CommonParameters>]
Example
> Test-NetConnection -ComputerName ayampenyet.com -Port 443
ComputerName : ayampenyet.com
RemoteAddress : 123.133.11.15
RemotePort : 443
InterfaceAlias : Wi-Fi
SourceAddress : 10.10.10.120
TcpTestSucceeded : True
##Above test/telnet is successful
> Test-NetConnection -ComputerName ayampenyet.com -Port 5050
WARNING: TCP connect to (123.133.11.15 : 5050) failed
ComputerName : ayampenyet.com
RemoteAddress : 123.133.11.15
RemotePort : 5050
InterfaceAlias : Wi-Fi
SourceAddress : 10.10.10.120
PingSucceeded : True
PingReplyDetails (RTT) : 302 ms
TcpTestSucceeded : False
##Above test/telnet is failed