Azure Virtual Network Gateway VPN Client Connection Cmdlets

Overview

This documentation provides a comprehensive reference for Azure PowerShell cmdlets designed to manage VPN client connection configurations for Azure Virtual Network Gateways. These cmdlets allow you to configure, retrieve, and manage settings related to establishing VPN connections from client devices to your Azure Virtual Network.

Azure VPN Gateway enables you to create secure, cross-premises connectivity options. VPN client access allows individual users to connect to your virtual network from their devices using a VPN client. The cmdlets in this module facilitate the configuration and management of these client VPN connections, including profile generation, authentication settings, and connectivity parameters.

Cmdlets

The following cmdlets are available for managing Azure Virtual Network Gateway VPN client connections:

Get-AzVpnClientConfiguration

Retrieves the VPN client configuration settings for a virtual network gateway.

View Example

Set-AzVpnClientConfiguration

Configures VPN client connection settings for a virtual network gateway.

View Example

New-AzVpnClientIPConfig

Creates a new IP configuration object for a VPN client IP pool.

View Example

Get-AzVpnClientIPConfig

Retrieves existing VPN client IP configuration objects.

View Example

Remove-AzVpnClientIPConfig

Removes a VPN client IP configuration object.

View Example

Get-AzVirtualNetworkGatewayVpnProfile

Generates and downloads VPN client profile packages for various operating systems.

View Example

Examples

Example 1: Retrieving VPN Client Configuration

This example shows how to get the VPN client configuration for a specific virtual network gateway.

# Set context to your Azure subscription Connect-AzAccount Select-AzSubscription -SubscriptionId "YOUR_SUBSCRIPTION_ID" # Define parameters $resourceGroupName = "MyResourceGroup" $gatewayName = "MyVpnGateway" # Get the VPN client configuration $vpnConfig = Get-AzVpnClientConfiguration -ResourceGroupName $resourceGroupName -VirtualNetworkGatewayName $gatewayName $vpnConfig

Example 2: Generating a VPN Client Profile Package

This example demonstrates how to generate and download a VPN client profile for Windows.

# Set context to your Azure subscription Connect-AzAccount Select-AzSubscription -SubscriptionId "YOUR_SUBSCRIPTION_ID" # Define parameters $resourceGroupName = "MyResourceGroup" $gatewayName = "MyVpnGateway" $outputFilePath = "C:\Downloads\VpnClientProfile.zip" $osType = "Windows" # Options: Windows, VpnClientLinux, VpnClientAzure # Generate and download the VPN client profile Get-AzVirtualNetworkGatewayVpnProfile -ResourceGroupName $resourceGroupName -VirtualNetworkGatewayName $gatewayName -AuthenticationMethod "EAPTLS" -ProfileName "WindowsClientProfile" -OSType $osType -OutputFileName $outputFilePath Write-Host "VPN client profile downloaded to: $outputFilePath"

Example 3: Creating a new VPN client IP configuration

This example creates an IP configuration for client VPNs.

# Define parameters for the IP configuration $name = "MyClientIPConfig" $startIpAddress = "10.10.0.0" $endIpAddress = "10.10.255.255" $subnetMask = "255.255.0.0" # Create the IP configuration object $ipConfig = New-AzVpnClientIPConfig -Name $name -StartIpAddress $startIpAddress -EndIpAddress $endIpAddress -SubnetMask $subnetMask Write-Host "VPN Client IP Configuration created:" $ipConfig