|
| 1 | +--- |
| 2 | +external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml |
| 3 | +Module Name: Az.Network |
| 4 | +online version: https://docs.microsoft.com/powershell/module/az.network/get-azvirtualnetworkgatewaynatrule |
| 5 | +schema: 2.0.0 |
| 6 | +--- |
| 7 | + |
| 8 | +# Get-AzVirtualNetworkGatewayNatRule |
| 9 | + |
| 10 | +## SYNOPSIS |
| 11 | +Gets a Virtual Network Gateway NatRule. |
| 12 | + |
| 13 | +## SYNTAX |
| 14 | + |
| 15 | +### ByVirtualNetworkGatewayName (Default) |
| 16 | +``` |
| 17 | +Get-AzVirtualNetworkGatewayNatRule -ResourceGroupName <String> -ParentResourceName <String> [-Name <String>] |
| 18 | + [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>] |
| 19 | +``` |
| 20 | + |
| 21 | +### ByVirtualNetworkGatewayObject |
| 22 | +``` |
| 23 | +Get-AzVirtualNetworkGatewayNatRule -ParentObject <PSVirtualNetworkGateway> [-Name <String>] |
| 24 | + [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>] |
| 25 | +``` |
| 26 | + |
| 27 | +### ByVirtualNetworkGatewayResourceId |
| 28 | +``` |
| 29 | +Get-AzVirtualNetworkGatewayNatRule -ParentResourceId <String> [-Name <String>] |
| 30 | + [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>] |
| 31 | +``` |
| 32 | + |
| 33 | +## DESCRIPTION |
| 34 | +**Get-AzVirtualNetworkGatewayNatRule** cmdlet returns a virtual network gateway nat rule object of your virtual network gateway based on Name and ParentResourceName. |
| 35 | + |
| 36 | +## EXAMPLES |
| 37 | + |
| 38 | +### Example 1 |
| 39 | +```powershell |
| 40 | +PS C:\Users> get-azVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -Name "natRule1" -ParentResourceName gw1 |
| 41 | +
|
| 42 | +Name : natRule1 |
| 43 | +ProvisioningState : Succeeded |
| 44 | +Type : Static |
| 45 | +Mode : IngressSnat |
| 46 | +InternalMappings : [ |
| 47 | + { |
| 48 | + "AddressSpace": "25.0.0.0/16" |
| 49 | + } |
| 50 | + ] |
| 51 | +ExternalMappings : [ |
| 52 | + { |
| 53 | + "AddressSpace": "30.0.0.0/16" |
| 54 | + } |
| 55 | + ] |
| 56 | +IpConfigurationId : |
| 57 | +Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1 |
| 58 | +Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9" |
| 59 | +``` |
| 60 | + |
| 61 | +### Example 2: |
| 62 | +```powershell |
| 63 | +PS C:\Users\khbaheti> get-azVirtualNetworkGatewayNatRule -ResourceGroupName "rg1" -ParentResourceName "gw1" |
| 64 | +
|
| 65 | +Name : natRule1 |
| 66 | +ProvisioningState : Succeeded |
| 67 | +Type : Static |
| 68 | +Mode : IngressSnat |
| 69 | +InternalMappings : [ |
| 70 | + { |
| 71 | + "AddressSpace": "25.0.0.0/16" |
| 72 | + } |
| 73 | + ] |
| 74 | +ExternalMappings : [ |
| 75 | + { |
| 76 | + "AddressSpace": "30.0.0.0/16" |
| 77 | + } |
| 78 | + ] |
| 79 | +IpConfigurationId : |
| 80 | +Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule1 |
| 81 | +Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9" |
| 82 | +
|
| 83 | +Name : natRule2 |
| 84 | +ProvisioningState : Succeeded |
| 85 | +Type : Static |
| 86 | +Mode : EgressSnat |
| 87 | +InternalMappings : [ |
| 88 | + { |
| 89 | + "AddressSpace": "20.0.0.0/16" |
| 90 | + } |
| 91 | + ] |
| 92 | +ExternalMappings : [ |
| 93 | + { |
| 94 | + "AddressSpace": "50.0.0.0/16" |
| 95 | + } |
| 96 | + ] |
| 97 | +IpConfigurationId : |
| 98 | +Id : /subscriptions/7afd8f92-c220-4f53-886e-1df53a69afd4/resourceGroups/rg1/providers/Microsoft.Network/virtualNetworkGateways/gw1/natRules/natRule2 |
| 99 | +Etag : W/"5150d788-e165-42ba-99c4-8138a545fce9" |
| 100 | +``` |
| 101 | + |
| 102 | + |
| 103 | +## PARAMETERS |
| 104 | + |
| 105 | +### -DefaultProfile |
| 106 | +The credentials, account, tenant, and subscription used for communication with Azure. |
| 107 | + |
| 108 | +```yaml |
| 109 | +Type: IAzureContextContainer |
| 110 | +Parameter Sets: (All) |
| 111 | +Aliases: AzContext, AzureRmContext, AzureCredential |
| 112 | + |
| 113 | +Required: False |
| 114 | +Position: Named |
| 115 | +Default value: None |
| 116 | +Accept pipeline input: False |
| 117 | +Accept wildcard characters: False |
| 118 | +``` |
| 119 | +
|
| 120 | +### -Name |
| 121 | +The resource name. |
| 122 | +
|
| 123 | +```yaml |
| 124 | +Type: String |
| 125 | +Parameter Sets: (All) |
| 126 | +Aliases: ResourceName, VirtualNetworkGatewayNatRuleName |
| 127 | + |
| 128 | +Required: False |
| 129 | +Position: Named |
| 130 | +Default value: None |
| 131 | +Accept pipeline input: False |
| 132 | +Accept wildcard characters: False |
| 133 | +``` |
| 134 | +
|
| 135 | +### -ParentObject |
| 136 | +The parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule. |
| 137 | +
|
| 138 | +```yaml |
| 139 | +Type: PSVirtualNetworkGateway |
| 140 | +Parameter Sets: ByVirtualNetworkGatewayObject |
| 141 | +Aliases: ParentVirtualNetworkGateway, VirtualNetworkGateway |
| 142 | + |
| 143 | +Required: True |
| 144 | +Position: Named |
| 145 | +Default value: None |
| 146 | +Accept pipeline input: True (ByValue) |
| 147 | +Accept wildcard characters: False |
| 148 | +``` |
| 149 | +
|
| 150 | +### -ParentResourceId |
| 151 | +The resource id of the parent VirtualNetworkGateway for this VirtualNetworkGatewayNatRule. |
| 152 | +
|
| 153 | +```yaml |
| 154 | +Type: String |
| 155 | +Parameter Sets: ByVirtualNetworkGatewayResourceId |
| 156 | +Aliases: ParentVirtualNetworkGatewayId, VirtualNetworkGatewayId |
| 157 | + |
| 158 | +Required: True |
| 159 | +Position: Named |
| 160 | +Default value: None |
| 161 | +Accept pipeline input: True (ByPropertyName) |
| 162 | +Accept wildcard characters: False |
| 163 | +``` |
| 164 | +
|
| 165 | +### -ParentResourceName |
| 166 | +The parent resource name. |
| 167 | +
|
| 168 | +```yaml |
| 169 | +Type: String |
| 170 | +Parameter Sets: ByVirtualNetworkGatewayName |
| 171 | +Aliases: ParentVirtualNetworkGatewayName, VirtualNetworkGatewayName |
| 172 | + |
| 173 | +Required: True |
| 174 | +Position: Named |
| 175 | +Default value: None |
| 176 | +Accept pipeline input: False |
| 177 | +Accept wildcard characters: False |
| 178 | +``` |
| 179 | +
|
| 180 | +### -ResourceGroupName |
| 181 | +The resource group name. |
| 182 | +
|
| 183 | +```yaml |
| 184 | +Type: String |
| 185 | +Parameter Sets: ByVirtualNetworkGatewayName |
| 186 | +Aliases: |
| 187 | + |
| 188 | +Required: True |
| 189 | +Position: Named |
| 190 | +Default value: None |
| 191 | +Accept pipeline input: False |
| 192 | +Accept wildcard characters: False |
| 193 | +``` |
| 194 | +
|
| 195 | +### CommonParameters |
| 196 | +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). |
| 197 | +
|
| 198 | +## INPUTS |
| 199 | +
|
| 200 | +### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGateway |
| 201 | +
|
| 202 | +### System.String |
| 203 | +
|
| 204 | +## OUTPUTS |
| 205 | +
|
| 206 | +### Microsoft.Azure.Commands.Network.Models.PSVirtualNetworkGatewayNatRule |
| 207 | +
|
| 208 | +## NOTES |
| 209 | +
|
| 210 | +## RELATED LINKS |
| 211 | +
|
| 212 | +[New-AzVirtualNetworkGatewayNatRule](./New-AzVirtualNetworkGatewayNatRule.md) |
| 213 | +
|
| 214 | +[Remove-AzVirtualNetworkGatewayNatRule](./Remove-AzVirtualNetworkGatewayNatRule.md) |
| 215 | +
|
| 216 | +[Update-AzVirtualNetworkGatewayNatRule](./Update-AzVirtualNetworkGatewayNatRule.md) |
0 commit comments