1

I'm using the following PowerShell command to create VPN Connection for the native Windows VPN client

Add-VpnConnection -Name "VPN" -ServerAddress "vpn.randomdomain.com" -TunnelType L2TP -L2tpPsk "SuperSecurePassword" -Force -AuthenticationMethod MSChapv2 -SplitTunneling $True -EncryptionLevel "Optional"

And it works perfectly! However, I'd like for the "Automatically use my Windows logon name and password" (and domain, if any) Checkbox (Under MS-CHAP v2) to be checked as well. How do I add that to my command ?

BaSsGaz
  • 666
  • 1
  • 18
  • 31
Hardcore Hartley
  • 51
  • 1
  • 1
  • 5

1 Answers1

4

I found how myself, add -UseWinlogonCredential after MSChapv2

simple enough!!

Example

Add-VpnConnection -Name "VPN" -ServerAddress "vpn.randomdoman.com" -TunnelType L2TP -L2tpPsk "SuperSecurePassword" -Force -AuthenticationMethod MSChapv2 -UseWinlogonCredential -SplitTunneling $True -EncryptionLevel "Optional"
Hardcore Hartley
  • 51
  • 1
  • 1
  • 5