Upravit

Sdílet prostřednictvím


Get-AzNetworkSecurityRuleConfig

Get a network security rule configuration for a network security group.

Syntax

Get-AzNetworkSecurityRuleConfig
   [-Name <String>]
   -NetworkSecurityGroup <PSNetworkSecurityGroup>
   [-DefaultRules]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Get-AzNetworkSecurityRuleConfig cmdlet gets a network security rule configuration for an Azure network security group.

Examples

Example 1: Retrieving a network security rule config

Get-AzNetworkSecurityGroup -Name nsg1 -ResourceGroupName rg1 `
    | Get-AzNetworkSecurityRuleConfig -Name AllowInternetOutBound -DefaultRules

This command retrieves the default rule named "AllowInternetOutBound" from Azure network security group named "nsg1" in resource group "rg1"

Example 2: Retrieving a network security rule config using only the name

Get-AzNetworkSecurityGroup -Name nsg1 -ResourceGroupName rg1 `
    | Get-AzNetworkSecurityRuleConfig -Name "rdp-rule"

This command retrieves user defined rule named "rdp-rule" from Azure network security group named "nsg1" in resource group "rg1"

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

-DefaultRules

Indicates whether this cmdlet gets a user-created rule configuration or a default rule configuration.

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

-Name

Specifies the name of the network security rule configuration to get.

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

-NetworkSecurityGroup

Specifies a NetworkSecurityGroup object that contains the network security rule configuration to get.

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

Inputs

PSNetworkSecurityGroup

Outputs

PSSecurityRule