Get-AzureRmNetworkSecurityRuleConfig

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

Syntax

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

Description

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

Examples

1: Retrieving a network security rule config

Get-AzureRmNetworkSecurityGroup -Name  nsg1 -ResourceGroupName rg1 
    | Get-AzureRmNetworkSecurityRuleConfig -Name AllowInternetOutBound -DefaultRules

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

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

Get-AzureRmNetworkSecurityGroup -Name  nsg1 -ResourceGroupName rg1 
    | Get-AzureRmNetworkSecurityRuleConfig -Name "rdp-rule"

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

Required Parameters

-NetworkSecurityGroup

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

Type:Microsoft.Azure.Commands.Network.Models.PSNetworkSecurityGroup
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-DefaultProfile

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

Type:Microsoft.Azure.Commands.Common.Authentication.Abstractions.IAzureContextContainer
Aliases:AzureRmContext, AzureCredential
Position:Named
Default value:None
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:System.Management.Automation.SwitchParameter
Position:Named
Default value:None
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
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSNetworkSecurityGroup

Parameter 'NetworkSecurityGroup' accepts value of type 'PSNetworkSecurityGroup' from the pipeline

Outputs

Microsoft.Azure.Commands.Network.Models.PSSecurityRule