< Back

Connect-VPN

Sat Jan 18, 2020 8:01 pm

NAME Connect-VPN



SYNOPSIS

Connects to a VPN Provider.





SYNTAX

Connect-VPN [-Provider] <String> [-Credential] <PSCredential> [<CommonParameters>]



Connect-VPN [-Provider] <String> [-User] <String> [-Password] <String> [<CommonParameters>]





DESCRIPTION

Connects this computer to a given VPN Provider.





PARAMETERS

-Provider <String>

The VPN Provider to use.

One of: AnyConnect



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

The PSCredential to use.



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-User <String>

If no PSCredential is provided, a User and a (plain text) Password must be provided.



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Password <String>

If no PSCredential is provided, a User and a (plain text) Password must be provided.



Required? true

Position? 5

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

The ComputerName can be piped in.





OUTPUTS

System.Management.Automation.PSObject

Represents the VPN connection (its Provider, the ComputerName, and the Credential).





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)



Description

-----------

Connects to a Cisco AnyConnect VPN at vpn.acme.com with the PSCredential entered via Get-Credential









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



PS C:\\>$session = Connect-VPN -Provider AnyConnect -ComputerName vpn.acme.com -User ACME\\gildas -Password s3cr3t



Description

-----------

Connects to a Cisco AnyConnect VPN at vpn.acme.com with the clear text user and password











RELATED LINKS

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