## 基本構文
```
Test-NetConnection [-ComputerName] <string> [-Port <int>] [-InformationLevel <string>] [-TraceRoute]
```
## 使用例一覧
### 1. ホストへの接続確認(Ping相当)
```
Test-NetConnection www.google.com
```
- ホスト名の名前解決と ICMP 通信確認
- PingSucceeded が True なら疎通可能
### 2. TCPポートの疎通確認(例:443)
```
Test-NetConnection -ComputerName 192.168.1.10 -Port 443
```
- 指定IPの443番ポートにTCP接続できるか確認
- TcpTestSucceeded が True ならポートが開いている
### 3. ホスト名+ポート確認(DNS解決付き)
```
Test-NetConnection -ComputerName example.com -Port 80
```
- ホスト名をDNSで解決し、HTTPポート(80)への接続確認
### 4. トレースルート付きで確認
```
Test-NetConnection www.microsoft.com -TraceRoute
```
- 通信経路(ルーターのホップ)を表示
### 5. LAN内のIPに対して443ポート確認(スクリプト)
```
$subnet = "192.168.1"
1..254 | ForEach-Object {
$ip = "$subnet.$_"
$result = Test-NetConnection -ComputerName $ip -Port 443 -WarningAction SilentlyContinue
if ($result.TcpTestSucceeded) {
Write-Host "$ip is listening on port 443"
}
}
```
- サブネット内の全ホストに対して443ポートの疎通確認
- 成功したIPのみ表示
## 出力例
```
ComputerName : 192.168.1.10
RemoteAddress : 192.168.1.10
RemotePort : 443
InterfaceAlias : Ethernet
TcpTestSucceeded : True
```
2025/11/12
PowerShellコマンド:Test-NetConnection 使用例
登録:
コメントの投稿 (Atom)
人気の投稿
-
## 作業前確認 [Amazon Linux 2023 リリースノート](https://docs.aws.amazon.com/ja_jp/linux/al2023/release-notes/relnotes.html) ### インスタンスのネットワーク設定 ``` ...
-
--- ## 地理構成・リージョン設計 | AWS | Azure | 説明 | |-----|-------|------| | - | ジオ | Azure独自の地理的分類単位 | | リージョン | リージョン | データセンター群の配置単位 | | - | リージョ...
-
[Security Hub の概念](https://docs.aws.amazon.com/ja_jp/securityhub/latest/userguide/securityhub-concepts.html) ### 設定単位 リージョン ### 主なコンポーネント ``...
-
## 基本構文 ``` Test-NetConnection [-ComputerName] <string> [-Port <int>] [-InformationLevel <string>] [-TraceRoute] ``` ## ...
-
スイッチングハブの冗長化 リンクアグリゲーション(IEEE802.3ad) 機器間(スイッチ⇔スイッチ、スイッチ⇔サーバ)で、複数本の物理リンクを集約して1つの論理リンクを構成し、冗長化とトラフィック分散、帯域幅の拡張を実現する仕組み。 IEEE802.3ad で LACP (L...
0 件のコメント:
コメントを投稿