Friday, October 23, 2026

[powershell][Windows] Detect the status of a remote Transport-layer port by Powershell

 PS C:\Users\XXXX> Test-NetConnection 142.251.156.119 -Port 443



ComputerName     : 142.251.156.119

RemoteAddress    : 142.251.156.119

RemotePort       : 443

InterfaceAlias   : Ethernet

SourceAddress    : YY.YY.YY.YY

TcpTestSucceeded : True




PS C:\Users\XXXX> Test-NetConnection 142.251.156.119 -Port 440

WARNING: TCP connect to (142.251.156.119 : 440) failed



ComputerName           : 142.251.156.119

RemoteAddress          : 142.251.156.119

RemotePort             : 440

InterfaceAlias         : Ethernet

SourceAddress          : YY.YY.YY.YY

PingSucceeded          : True

PingReplyDetails (RTT) : 4 ms

TcpTestSucceeded       : False

No comments:

Post a Comment