Modifier

Partager via


Disconnect-AzVirtualNetworkGatewayVpnConnection

Disconnect given connected vpn client connections with a given virtual network gateway.

Syntax

Disconnect-AzVirtualNetworkGatewayVpnConnection
          -VirtualNetworkGatewayName <String>
          -ResourceGroupName <String>
          -VpnConnectionId <String[]>
          [-AsJob]
          [-PassThru]
          [-DefaultProfile <IAzureContextContainer>]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]
Disconnect-AzVirtualNetworkGatewayVpnConnection
          -ResourceId <String>
          -VpnConnectionId <String[]>
          [-AsJob]
          [-PassThru]
          [-DefaultProfile <IAzureContextContainer>]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]
Disconnect-AzVirtualNetworkGatewayVpnConnection
          [-InputObject <PSVirtualNetworkGateway>]
          -VpnConnectionId <String[]>
          [-AsJob]
          [-PassThru]
          [-DefaultProfile <IAzureContextContainer>]
          [-WhatIf]
          [-Confirm]
          [<CommonParameters>]

Description

The Disconnect-AzVirtualNetworkGatewayVpnConnection cmdlet enables you to disconnect given connected vpn client connection.

Examples

Example 1

Disconnect-AzVirtualNetworkGatewayVpnConnection -ResourceName vnet-gw -ResourceGroupName vnetgwrg -VpnConnectionId @("IKEv2_7e1cfe59-5c7c-4315-a876-b11fbfdfeed4")

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Virtual network gateway object

Type:PSVirtualNetworkGateway
Aliases:VirtualNetworkGateway
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-PassThru

Returns an object representing the item on which this operation is being performed.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

Virtual network gateway resource group's name

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceId

Virtual network gateway resource Id

Type:String
Aliases:VirtualNetworkGatewayId
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VirtualNetworkGatewayName

Virtual network gateway name

Type:String
Aliases:ResourceName
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-VpnConnectionId

Vpn Connection Ids

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

Outputs

PSVirtualNetworkGateway