Created
August 3, 2018 11:03
-
-
Save puttyq/eac6414f92724446711c0ab2fb713394 to your computer and use it in GitHub Desktop.
Creating and connecting to a Windows built-in L2TP VPN Connection
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get All VPN Connections | |
Get-VpnConnection | |
# Create VPN Connection to Office L2TP | |
Add-VpnConnection -Name "Test" ` | |
-ServerAddress "xxxxxxxxxx" ` | |
-TunnelType L2TP ` | |
-L2tpPsk "xxxxxxxxxxxx" ` | |
-EncryptionLevel Optional ` | |
-AuthenticationMethod MsChapv2 ` | |
-SplitTunneling -Force | |
#Delete a VPN Connection | |
Remove-VpnConnection "Office VPN Connection" -Force | |
#Dail a VPN Connection | |
rasdail.exe "Test" user password | |
#Close a VPN connection | |
rasdail.exe "Test" /Disconnect |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment