< Back

Get-AzureRmNetworkSecurityRuleConfig

Tue Jan 29, 2019 9:54 pm

NAME Get-AzureRmNetworkSecurityRuleConfig



SYNOPSIS

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





SYNTAX

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

<PSNetworkSecurityGroup> [<CommonParameters>]





DESCRIPTION

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





PARAMETERS

-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultRules [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Name <String>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-NetworkSecurityGroup <PSNetworkSecurityGroup>

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



Required? true

Position? named

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

PSNetworkSecurityGroup

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





OUTPUTS

Microsoft.Azure.Commands.Network.Models.PSSecurityRule







NOTES









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"







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... ruleconfig

Add-AzureRmNetworkSecurityRuleConfig

New-AzureRmNetworkSecurityRuleConfig

Remove-AzureRmNetworkSecurityRuleConfig

Set-AzureRmNetworkSecurityRuleConfig