- 追加された行はこの色です。
- 削除された行はこの色です。
#author("2020-02-26T10:24:29+09:00","","")
#author("2020-02-26T11:26:43+09:00","","")
PowerShell で特定 TCP ポートが開いているか確認する方法は以下の通り。
*コマンド [#df17b343]
Test-NetConnection [ターゲット] -Port [ポート番号]
*実行例 [#t26d9fcf]
**失敗時 [#s5ace47e]
>Test-NetConnection 192.168.0.33 -Port 5432
警告: TCP connect to (192.168.0.33 : 5432) failed
ComputerName : 192.168.0.33
RemoteAddress : 192.168.0.33
RemotePort : 5432
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.0.38
PingSucceeded : True
PingReplyDetails (RTT) : 1 ms
TcpTestSucceeded : False
**成功時 [#l5a171d7]
>Test-NetConnection 192.168.0.33 -Port 5432
ComputerName : 192.168.0.33
RemoteAddress : 192.168.0.33
RemotePort : 5432
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.0.38
TcpTestSucceeded : True