Get-AzVirtualNetworkGatewayNatRule
Gets a Virtual Network Gateway NatRule.
Syntax
ByVirtualNetworkGatewayName (Default)
Get-AzVirtualNetworkGatewayNatRule
-ResourceGroupName <String>
-ParentResourceName <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByVirtualNetworkGatewayObject
Get-AzVirtualNetworkGatewayNatRule
-ParentObject <PSVirtualNetworkGateway>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
ByVirtualNetworkGatewayResourceId
Get-AzVirtualNetworkGatewayNatRule
-ParentResourceId <String>
[-Name <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Get-AzVirtualNetworkGatewayNatRule cmdlet returns a virtual network gateway nat rule object of your virtual network gateway based on Name and ParentResourceName.
Examples
Example 1
Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -Name "natRule1" -ParentResourceName gw1
Name : natRule1
ProvisioningState : Succeeded
Type : Static
Mode : IngressSnat
InternalMappings : [
{
"AddressSpace": "25.0.0.0/16"
}
]
ExternalMappings : [
{
"AddressSpace": "30.0.0.0/16"
}
]
IpConfigurationId :
Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1
Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9"
Example 2:
Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -ParentResourceName "gw1"
Name : natRule1
ProvisioningState : Succeeded
Type : Static
Mode : IngressSnat
InternalMappings : [
{
"AddressSpace": "25.0.0.0/16"
}
]
ExternalMappings : [
{
"AddressSpace": "30.0.0.0/16"
}
]
IpConfigurationId :
Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1
Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9"
Name : natRule2
ProvisioningState : Succeeded
Type : Static
Mode : EgressSnat
InternalMappings : [
{
"AddressSpace": "20.0.0.0/16"
}
]
ExternalMappings : [
{
"AddressSpace": "50.0.0.0/16"
}
]
IpConfigurationId :
Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule2
Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9"
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
-Name
The resource name.
Parameter properties
Type: String
Default value: None
Supports wildcards: True
DontShow: False
Aliases: ResourceName, VirtualNetworkGatewayNatRuleName
Parameter sets
(All)
Position: Named
Mandatory: False
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ParentObject
The parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule.
Parameter properties
Type: PSVirtualNetworkGateway
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ParentVirtualNetworkGateway, VirtualNetworkGateway
Parameter sets
ByVirtualNetworkGatewayObject
Position: Named
Mandatory: True
Value from pipeline: True
Value from pipeline by property name: False
Value from remaining arguments: False
-ParentResourceId
The resource id of the parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ParentVirtualNetworkGatewayId, VirtualNetworkGatewayId
Parameter sets
ByVirtualNetworkGatewayResourceId
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: True
Value from remaining arguments: False
-ParentResourceName
The parent resource name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Aliases: ParentVirtualNetworkGatewayName, VirtualNetworkGatewayName
Parameter sets
ByVirtualNetworkGatewayName
Position: Named
Mandatory: True
Value from pipeline: False
Value from pipeline by property name: False
Value from remaining arguments: False
-ResourceGroupName
The resource group name.
Parameter properties
Type: String
Default value: None
Supports wildcards: False
DontShow: False
Parameter sets
ByVirtualNetworkGatewayName
Position: Named
Mandatory: True
Value from pipeline: False
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 .
Outputs