richardhicks / aovpn

PowerShell scripts and sample ProfileXML files for configuring Windows 10 Always On VPN
MIT License
160 stars 85 forks source link

Registry error (RasMan) at device tunnel creation #23

Open Supaxor opened 5 days ago

Supaxor commented 5 days ago

Hi,

I tried to configure AlwaysOn Device Tunnel but when I start the script as system user (planned task), I got the following error in powershell logs : Erreur de terminaison (Get-ItemPropertyValue) : « L’exécution de la commande s’est arrêtée, car la variable de préférence « ErrorActionPreference » ou le paramètre courant a la valeur Stop : Impossible de trouver le chemin d'accès « HKLM:\System\CurrentControlSet\Services\RasMan\Config\ », car il n'existe pas. » Unable to create "VPN Device Tunnel" profile: Exception lors de l'appel de « CreateInstance » avec « 2 » argument(s) : « Une erreur générale qui n’est pas couverte par un code d’erreur plus spécifique s’est produite. »

I saw that this registry key do not exist on Windows 11 Enterprise ou Windows 10 Pro. What should I do ? Thank you, Regards,

nilv69 commented 4 days ago

Hello, have you tried a name without spaces?

Supaxor commented 4 days ago

No, but I think the problem is not in the name, but in this line: image

richardhicks commented 4 days ago

The -ErrorAction Stop should trigger the Catch block which returns a verbose message indicating the registry path does not exist. Does your error message indicate which line the error occurred? Also, it's possible this is a localization issue. I've only ever tested this script using the EN-US language.

Supaxor commented 4 days ago

I only have what you see on screen (in a French OS), the script stop because HKLM:\System\CurrentControlSet\Services\RasMan\Config\ doesn't exist

richardhicks commented 4 days ago

Ok, thanks. Again, that section of code should trigger the Catch block and surface a verbose message. Why that's not happening for you I have no idea. I suspect a localization issue because I don't have this problem on EN-US versions of Windows. Is there any way you could test on a machine with EN-US language installed? I'd be curious to know if the problem still exists for you there.

richardhicks commented 4 days ago

Also, do you get this error if you run the script interactively as SYSTEM, not as a scheduled task?