Set-vpn
1 TopicInstall/Configure VPN For All Users
I am trying to automate the setup and configuration of the Windows VPN for all users on remote worker laptops after I have configured their azure profile on the machine. The machines are all running Windows 10 Pro version 21H2. I would like it so that I can log into the azuread admin profile on the machine, run the script and be done with it to where the users can simply click "Connect" on the VPN and it connects them. However, the problem I am running into is that, when I run the script, the VPN is installed on all user profiles, but the connection only works on the admin account. When trying to connect on a user profile, I am prompted with a window asking for username and password. Which is strange because it is being passed through by the script for the admin profile, but not the user profile. The VPN is through Meraki client VPN so I can't use any other type of auth method. The script I am running is below: set-executionpolicy remotesigned Import-Module PowerShellGet Install-Module -Name VPNCredentialsHelper $name = "VPN NAME" $address = "VPN ADDRESS" $username = "VPN USERNAME" $plainpassword = "VPN PASSWORD" Add-VpnConnection -Name $name -ServerAddress $address -TunnelType L2tp -AuthenticationMethod PAP -L2tpPsk "PRESHARED KEY" -Force:$true -AllUserConnection -RememberCredential:$true -SplitTunneling:$false Set-VpnConnectionUsernamePassword -connectionname $name -username $username -password $plainpassword -domain ''13KViews0likes7Comments