rasdial changing username and password fails establishing network connection of vpn?

Anonymous
2024-03-04T09:43:07+00:00

I was using this command to create a new vpn

Add-VpnConnection -Name "Connection_Name" -ServerAddress "Server_Address or IP" -TunnelType "Ikev2" -EncryptionLevel "Optional" -AuthenticationMethod Eap -SplitTunneling -RememberCredential -PassThru

--The connection created successfully.

Then to modify the vpn connection

Set-VpnConnection -Name "Connection_Name" -ServerAddress "Server_Address or IP"

--The server address changes successfully

Then for setting the username and password

Set-VpnConnectionUsernamePassword -connectionname "Connection_Name" -username "Your_Username" -password "Your_Password"

It changed if check it in the UI Interface of vpn connection in windows.

But when I try to connect with command--

rasdial "Connection_Name" "Username" "Password"

--It fails to connect the username and password doesn't changes. I find that out from the server. But if I try to connect from the UI interface. The username and password takes new ones and sets it. Then if we run the command to connect again it's successfully gets connected.

So, my question is does the username and password gets store into some sort of cache. If so how can I change it to new one? If there is other module which changes username and the password better?

Windows for business Windows Client for IT Pros Networking Other

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question. To protect privacy, user profiles for migrated questions are anonymized.

0 comments No comments
{count} votes
Accepted answer
  1. Anonymous
    2024-03-05T08:55:19+00:00

    Hello,

    The Windows operating system does cache credentials for network connections, including VPNs. The rasdial command might be using cached credentials rather than the updated ones you set with Set-VpnConnectionUsernamePassword.

    To clear the cached credentials and ensure that rasdial uses the new username and password:

    1.Clear Cached Credentials:

    a.Open Credential Manager (control /name Microsoft.CredentialManager).

    b.Locate the entry for your VPN connection under "Generic Credentials" or "Windows Credentials".

    c.Remove the cached credentials.

    2.If you want to ensure that the new credentials are saved in the connection properties, you can run the Set-VpnConnectionUsernamePassword again after clearing the cache.

    3.After clearing the cached credentials, try connecting with rasdial again:rasdial "Connection_Name" "Your_Username" "Your_Password"

    Best regards

    Zunhui

    0 comments No comments

0 additional answers

Sort by: Most helpful