你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic
针对目标资源上的指定网络配置文件调用网络配置诊断会话。
语法
Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic
-NetworkWatcher <PSNetworkWatcher>
-TargetResourceId <String>
[-VerbosityLevel <String>]
-Profile <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSNetworkConfigurationDiagnosticProfile]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic
-NetworkWatcherName <String>
-ResourceGroupName <String>
-TargetResourceId <String>
[-VerbosityLevel <String>]
-Profile <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSNetworkConfigurationDiagnosticProfile]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic
-Location <String>
-TargetResourceId <String>
[-VerbosityLevel <String>]
-Profile <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSNetworkConfigurationDiagnosticProfile]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic
-ResourceId <String>
-TargetResourceId <String>
[-VerbosityLevel <String>]
-Profile <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Network.Models.PSNetworkConfigurationDiagnosticProfile]>
[-AsJob]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
说明
Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic cmdlet 针对目标资源上的指定网络配置文件调用网络配置诊断会话。
示例
示例 1:为 VM 调用网络配置诊断会话和指定的网络配置文件
$profile = New-AzNetworkWatcherNetworkConfigurationDiagnosticProfile -Direction Inbound -Protocol Tcp -Source 10.1.1.4 -Destination * -DestinationPort 50
Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic -Location eastus -TargetResourceId /subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgEastUS/providers/Microsoft.Compute/virtualMachines/vm1 -Profile $profile
Results : [
{
"Profile": {
"Direction": "Inbound",
"Protocol": "Tcp",
"Source": "10.1.1.4",
"Destination": "*",
"DestinationPort": "50"
},
"NetworkSecurityGroupResult": {
"SecurityRuleAccessResult": "Allow",
"EvaluatedNetworkSecurityGroups": [
{
"NetworkSecurityGroupId": "/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/clean
upservice/providers/Microsoft.Network/networkSecurityGroups/rg-cleanupservice-nsg1",
"MatchedRule": {
"RuleName": "UserRule_Cleanuptool-Allow-4001",
"Action": "Allow"
},
"RulesEvaluationResult": [
{
"Name": "UserRule_Cleanuptool-Allow-100",
"ProtocolMatched": true,
"SourceMatched": false,
"SourcePortMatched": true,
"DestinationMatched": true,
"DestinationPortMatched": false
},
参数
-AsJob
在后台运行 cmdlet
类型: | SwitchParameter |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-DefaultProfile
用于与 Azure 通信的凭据、帐户、租户和订阅。
类型: | IAzureContextContainer |
别名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Location
网络观察程序的位置。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-NetworkWatcher
网络观察程序资源。
类型: | PSNetworkWatcher |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-NetworkWatcherName
网络观察程序的名称。
类型: | String |
别名: | Name |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-Profile
网络配置诊断配置文件列表。
类型: | List<T>[PSNetworkConfigurationDiagnosticProfile] |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceGroupName
网络观察程序资源组的名称。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | False |
接受通配符: | False |
-ResourceId
资源 ID。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-TargetResourceId
要执行网络配置诊断的目标资源的 ID。 有效选项包括 VM、NetworkInterface、VMSS/NetworkInterface 和 应用程序网关。
类型: | String |
Position: | Named |
默认值: | None |
必需: | True |
接受管道输入: | True |
接受通配符: | False |
-VerbosityLevel
详细级别。 接受的值为“Normal”、“Minimum”、“Full”。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
输入
输出
PSNetworkConfigurationDiagnosticResponse
备注
关键字:azure, azurerm, arm, 资源, 管理, 管理器, 网络, 网络, 观察程序, 诊断, 配置文件
相关链接
- New-AzNetworkWatcher
- Get-AzNetworkWatcher
- Remove-AzNetworkWatcher
- Get-AzNetworkWatcherNextHop
- Get-AzNetworkWatcherSecurityGroupView
- Get-AzNetworkWatcherTopology
- Start-AzNetworkWatcherResourceTroubleshooting
- New-AzNetworkWatcherPacketCapture
- New-AzPacketCaptureFilterConfig
- Get-AzNetworkWatcherPacketCapture
- Remove-AzNetworkWatcherPacketCapture
- Stop-AzNetworkWatcherPacketCapture
- New-AzNetworkWatcherProtocolConfiguration
- Test-AzNetworkWatcherIPFlow
- Test-AzNetworkWatcherConnectivity
- Stop-AzNetworkWatcherConnectionMonitor
- Start-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConnectionMonitor
- Set-AzNetworkWatcherConfigFlowLog
- Remove-AzNetworkWatcherConnectionMonitor
- New-AzNetworkWatcherConnectionMonitor
- Get-AzNetworkWatcherTroubleshootingResult
- Get-AzNetworkWatcherReachabilityReport
- Get-AzNetworkWatcherReachabilityProvidersList
- Get-AzNetworkWatcherFlowLogStatus
- Get-AzNetworkWatcherConnectionMonitorReport
- Get-AzNetworkWatcherConnectionMonitor