我正在使用以下 PowerShell 命令为 native Windows VPN 客户端创建 VPN 连接
Add-VpnConnection -Name "VPN" -ServerAddress "vpn.randomdomain.com" -TunnelType L2TP -L2tpPsk "SuperSecurePassword" -Force -AuthenticationMethod MSChapv2 -SplitTunneling $True -EncryptionLevel "Optional"
而且效果很好!但是,我也希望选中“自动使用我的 Windows 登录名和密码”(和域,如果有的话)复选框(在 MS-CHAP v2 下)。如何将其添加到我的命令中?
最佳答案
我自己找到了方法,在 MSChapv2 之后添加 -UseWinlogonCredential
足够简单!!
例子
Add-VpnConnection -Name "VPN" -ServerAddress "vpn.randomdoman.com" -TunnelType L2TP -L2tpPsk "SuperSecurePassword" -Force -AuthenticationMethod MSChapv2 -UseWinlogonCredential -SplitTunneling $True -EncryptionLevel "Optional"
关于windows - 在 PowerShell 中创建 VPN 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46777369/