< Back

Disconnect-VPN

Sat Jan 18, 2020 8:02 pm

NAME Disconnect-VPN



SYNOPSIS

Disconnect from a VPN Session or Provider.





SYNTAX

Disconnect-VPN [-VPNSession] <PSObject> [<CommonParameters>]



Disconnect-VPN [-Provider] <String> [<CommonParameters>]





DESCRIPTION

Disconnect this computer from a given VPN Session or Provider.





PARAMETERS

-VPNSession <PSObject>

The VPN session object returned by Connect-VPN.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Provider <String>

The VPN Provider to use.

One of: AnyConnect



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Only Cisco AnyConnect VPNs are supported as of now.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>$session = Connect-VPN -Provider AnyConnect -ComputerName vpn.acme.com -Credentials (Get-Credential

ACME\\gildas)



Disconnect-VPN $session



Description

-----------

Disconnects from a Cisco AnyConnect VPN session









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Disconnect-VPN -Provider AnyConnect



Description

-----------

Disconnects from any Cisco AnyConnect VPN











RELATED LINKS

https://github.com/gildas/posh-vpn