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