Get-​Azure​Rm​Network​Security​Rule​Config

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

Syntax

Get-AzureRmNetworkSecurityRuleConfig
   [-DefaultRules]
   [-InformationAction <ActionPreference>]
   [-InformationVariable <String>]
   [-Name <String>]
   -NetworkSecurityGroup <PSNetworkSecurityGroup>
   [<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:PSNetworkSecurityGroup
Position:Named
Default value:None
Accept pipeline input:True (ByValue)
Accept wildcard characters:False

Optional Parameters

-DefaultRules

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

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

Specifies how this cmdlet responds to an information event.The acceptable values for this parameter are:- Continue

  • Ignore
  • Inquire
  • SilentlyContinue
  • Stop
  • Suspend
Type:ActionPreference
Aliases:infa
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-InformationVariable

Specifies an information variable.

Type:String
Aliases:iv
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