Editar

Compartir a través de


Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic

Invoke network configuration diagnostic session for specified network profiles on target resource.

Syntax

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>]

Description

The Invoke-AzNetworkWatcherNetworkConfigurationDiagnostic cmdlet invoke network configuration diagnostic session for specified network profiles on target resource.

Examples

Example 1: Invoke network configuration diagnostic session for VM and specified network profile

$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
                      },

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Location

Location of the network watcher.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-NetworkWatcher

The network watcher resource.

Type:PSNetworkWatcher
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-NetworkWatcherName

The name of network watcher.

Type:String
Aliases:Name
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Profile

List of network configuration diagnostic profiles.

Type:List<T>[PSNetworkConfigurationDiagnosticProfile]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the network watcher resource group.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

Resource ID.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TargetResourceId

The ID of the target resource to perform network configuration diagnostic. Valid options are VM, NetworkInterface, VMSS/NetworkInterface and Application Gateway.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VerbosityLevel

Verbosity level. Accepted values are 'Normal', 'Minimum', 'Full'.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSNetworkWatcher

String

Outputs

PSNetworkConfigurationDiagnosticResponse

Notes

Keywords: azure, azurerm, arm, resource, management, manager, network, networking, watcher, diagnostic, profile