Hello @WidmerLeonhard-5617
The error in English reads as: "Error 619: A connection to the remote computer could not be established, so the port used for this connection was closed." Maybe you can find more information with that string.
On the other hand, in my experience, this corresponds either with:
- restriction to connect (on the destination side)
- wrong user/password or lack of permissions
- GRE disabled on router (depending on the router, there are even firmware issues regarding this tunneling)
- Other firewall/security settings
I guess that in your case, the question is also:
Was the script working before improvements?
Does the VPN connect successfully when run manually (without the script)?
Do you see any error in Event viewer either on the source or destination of the connection?
Have you tried to take some network trace at the moment of running the script?
Hope this is helpful for you, Best regards.
--If the the reply is helpful, please Upvote and Accept as answer--