The built-in VPN client in Windows, by default, does not let you connect to the VPN server before the user signs in. This poses a challenge for Active Directory-linked computers that connect to the domain network via VPN. Users can log into their systems using stored domain credentials and then establish a VPN connection. However, for these users, accessing shared folders and other domain resources, particularly after modifying or resetting the domain password, can lead to consistent issues.
Windows allows users to hook up with the VPN server before signing in. After establishing a VPN connection in this scenario, the user undergoes a complete authentication process on the AD domain controller.
In earlier Windows versions, this could be done by enabling the ‘Allow other people to use this connection’ option in VPN connection configurations. However, this feature is currently missing from Windows 10 and 11 versions.
In new versions of Windows, you can create a shared VPN connection from the PowerShell console. For example, to create an L2TP VPN connection with a shared key, use the command:
Add-VpnConnection -Name WorkVPN_L2TP -ServerAddress "vpn.woshub.com" -TunnelType L2TP -L2tpPsk "My1pre-SharedKey2" -Force -EncryptionLevel "Required" -AuthenticationMethod MSChapv2 -RememberCredential -AllUserConnection $true –PassThru
How to fix L2TP/IPsec VPN connection error on Windows.
The -AllUserConnection $true setting permits the creation of a shared VPN connection that’s accessible to all Windows users, including those on the Windows login screen.
The shared VPN connection settings can be altered later on using the Control Panel graphical interface (ncpa.cpl
).
Existing VPN connections within your profile can be publicized by transferring the rasphone.pbk file from %userprofile%AppDataRoamingMicrosoftNetworkConnectionsPBK
to C:ProgramDataMicrosoftNetworkConnectionsPBK
.
You can now connect to the VPN from the Windows login screen. Click on the network connection icon in the bottom right-hand corner.
Type in the user name and password for the VPN connection.
Your computer should establish a VPN connection to your company network, and you can sign in to Windows using your domain user account.