Get-AzNetworkSecurityRuleConfig
Get a network security rule configuration for a network security group.
Syntax
Default (Default)
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.
Parameter properties
| Type: | IAzureContextContainer |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
| Aliases: | AzContext, AzureRmContext, AzureCredential |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-DefaultRules
Indicates whether this cmdlet gets a user-created rule configuration or a default rule configuration.
Parameter properties
| Type: | SwitchParameter |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-Name
Specifies the name of the network security rule configuration to get.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | False |
| Value from pipeline: | False |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
-NetworkSecurityGroup
Specifies a NetworkSecurityGroup object that contains the network security rule configuration to get.
Parameter properties
| Type: | PSNetworkSecurityGroup |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
(All)
| Position: | Named |
| Mandatory: | True |
| Value from pipeline: | True |
| Value from pipeline by property name: | False |
| Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.