Windows MSA Account - OpenVPNService - Won't auto-connect
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 4
- Joined: Tue Mar 22, 2022 6:44 am
Windows MSA Account - OpenVPNService - Won't auto-connect
Greetings,
I'm playing around with using the OpenVPN-GUI/Service to connect to a server however I'm getting no output when running the commands from powershell, via a Scheduled Task.
I am 100% certain the scheduled task executes, debug from the powershell script goes into EventViewer, however, when it comes time to doing the OpenVpn-GUI --connect <profile>, it doesn't give me any output.
I've assumed this was due to a lack of administrator privilages.
So I uninstalled and reinstalled and selected to install the service this time.
I've since tried to run openvpn --config <profile> and an assortment of other commands, none of actually worked within the context of the MSA running from a scheduled task.
I've read and re-read https://openvpn.net/community-resources ... n-process/ and apparently missed something obviously very simply.
Any help would be appreciated.
I'm playing around with using the OpenVPN-GUI/Service to connect to a server however I'm getting no output when running the commands from powershell, via a Scheduled Task.
I am 100% certain the scheduled task executes, debug from the powershell script goes into EventViewer, however, when it comes time to doing the OpenVpn-GUI --connect <profile>, it doesn't give me any output.
I've assumed this was due to a lack of administrator privilages.
So I uninstalled and reinstalled and selected to install the service this time.
I've since tried to run openvpn --config <profile> and an assortment of other commands, none of actually worked within the context of the MSA running from a scheduled task.
I've read and re-read https://openvpn.net/community-resources ... n-process/ and apparently missed something obviously very simply.
Any help would be appreciated.
- openvpn_inc
- OpenVPN Inc.
- Posts: 1333
- Joined: Tue Feb 16, 2021 10:41 am
Re: Windows MSA Account - OpenVPNService - Won't auto-connect
Hi MrA,
The only thing I can suggest is that you check your profile for a "daemon" line and comment that. This would force openvpn to run in the foreground, and from there you might see what's happening (or not happening, as the case may be.)
regards, rob0
The only thing I can suggest is that you check your profile for a "daemon" line and comment that. This would force openvpn to run in the foreground, and from there you might see what's happening (or not happening, as the case may be.)
regards, rob0
OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support
-
- OpenVpn Newbie
- Posts: 4
- Joined: Tue Mar 22, 2022 6:44 am
Re: Windows MSA Account - OpenVPNService - Won't auto-connect
Unfortunately as it's running as an MSA, we can't actually see the GUI at all. Even forcing logging to a specific directory produces no results.
Are we supposed to use openvpn.exe instead of the gui when connecting programmatically?
I've also tried this; https://openvpn.net/community-resources ... le-window/
Without success.
Seems to be a relatively straight forward exercise;
Have scheduled task
Connect to vpn
...
Profit?
Are we supposed to use openvpn.exe instead of the gui when connecting programmatically?
I've also tried this; https://openvpn.net/community-resources ... le-window/
Without success.
Seems to be a relatively straight forward exercise;
Have scheduled task
Connect to vpn
...
Profit?
- openvpn_inc
- OpenVPN Inc.
- Posts: 1333
- Joined: Tue Feb 16, 2021 10:41 am
Re: Windows MSA Account - OpenVPNService - Won't auto-connect
Hi MrA,
Are you not able to read or edit your profile? Then no, this will not be simple.
Yes, of course it makes more sense to use a command line tool for automated tasks. I've never done that on Windows. Are you not able to connect in to a PowerShell? I was thinking you could read and edit your profile, but if you can't, ugh.
regards, rob0
Are you not able to read or edit your profile? Then no, this will not be simple.
Yes, of course it makes more sense to use a command line tool for automated tasks. I've never done that on Windows. Are you not able to connect in to a PowerShell? I was thinking you could read and edit your profile, but if you can't, ugh.
regards, rob0
OpenVPN Inc.
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support
Answers provided by OpenVPN Inc. staff members here are provided on a voluntary best-effort basis, and no rights can be claimed on the basis of answers posted in this public forum. If you wish to get official support from OpenVPN Inc. please use the official support ticket system: https://openvpn.net/support
-
- OpenVpn Newbie
- Posts: 4
- Joined: Tue Mar 22, 2022 6:44 am
Re: Windows MSA Account - OpenVPNService - Won't auto-connect
Technically, we can use PSExec to execute a powershell script as the MSA account, however, it executes using Administrator privileges within the security context. Which bypasses the problem and isn't usable via Scheduled Task.
I can't grant the MSA Administrator access as it would mean anyone with access to the server would theoretically be able to rewrite the script to grant themselves admin privs.
We can modify environment and user variables within the context of the MSA though.
I can't grant the MSA Administrator access as it would mean anyone with access to the server would theoretically be able to rewrite the script to grant themselves admin privs.
We can modify environment and user variables within the context of the MSA though.
-
- OpenVpn Newbie
- Posts: 4
- Joined: Tue Mar 22, 2022 6:44 am
Re: Windows MSA Account - OpenVPNService - Won't auto-connect
I've found that the OpenVPN Service does execute the AutoConfig after a server reboot.
Which is extremely odd but it works!
Which is extremely odd but it works!
-
- OpenVpn Newbie
- Posts: 3
- Joined: Sun Jul 03, 2022 2:45 am
Re: Windows MSA Account - OpenVPNService - Won't auto-connect
Excellent it seems you have found the solution.
-
- OpenVPN Protagonist
- Posts: 11136
- Joined: Fri Jun 03, 2016 1:17 pm
Re: Windows MSA Account - OpenVPNService - Won't auto-connect
A service restart would do the same.MrAutomation wrote: ↑Fri Mar 25, 2022 12:48 amI've found that the OpenVPN Service does execute the AutoConfig after a server reboot.
Which is extremely odd but it works!