Upravit

Sdílet prostřednictvím


New-AzNetworkWatcherNetworkConfigurationDiagnosticProfile

Creates a new network configuration diagnostic profile object. This object is used to restrict the network configuration during a diagnostic session using the specified criteria.

Syntax

New-AzNetworkWatcherNetworkConfigurationDiagnosticProfile
   -Direction <String>
   -Protocol <String>
   -Source <String>
   -Destination <String>
   -DestinationPort <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The New-AzNetworkWatcherNetworkConfigurationDiagnosticProfile cmdlet creates a new diagnostic profile object. This object is used to restrict the network configuration during a network configuration diagnostic session using the specified criteria.

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

-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

-Destination

Traffic destination. Accepted values are: '*', IP Address/CIDR, Service Tag.

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

-DestinationPort

Traffic destination port. Accepted values are '*', port (for example, 3389) and port range (for example, 80-100).

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

-Direction

The direction of the traffic. Accepted values are 'Inbound' and 'Outbound'

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

-Protocol

Protocol to be verified on. Accepted values are '*', TCP, UDP.

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

-Source

Traffic source. Accepted values are '*', IP Address/CIDR, Service Tag.

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

Inputs

String

Outputs

PSNetworkConfigurationDiagnosticProfile

Notes

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