0

This is the code I use

Add-VpnConnection -Name 'vpn' -ServerAddress 'vpn.server.com'
rasdial 'vpn' 'username' 'password'

When the VPN disconnects and reconnects, it asks the client to enter the vpn password,

I want a way to bypass asking client for the password

enter image description here

1

1 Answer 1

1

You need to add -RememberCredential parameter when creating the VPN connection as indicated here:

-RememberCredential

     Indicates that the credentials supplied at the time of first successful connection are stored in the cache.

Your cmdlet should be:

Add-VpnConnection -Name 'vpn' -ServerAddress 'vpn.server.com' -RememberCredential

The first time you connect, you will be asked for the username and password. Next time you connect, it will remember them and connect without asking for the username and password.

1
  • If no one sends a direct solution within an hour without typing in the password the first time, I'll give you 3 points (: May 1, 2023 at 17:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .