Windows User Connect Script not working

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
TMTI Support
OpenVpn Newbie
Posts: 9
Joined: Mon Oct 30, 2017 2:46 pm

Windows User Connect Script not working

Post by TMTI Support » Wed Jun 02, 2021 11:05 am

Hi All

I have followed the example in
https://openvpn.net/vpn-server-resource ... work-share

But I can't get the Windows User Connect Script to work.

In the Windows User Connect Script I have
start \\192.168.10.170\VPNUser\shares.exe

There is a file that can seen at that location. It has the widest open permissions.

I connect to the VPN server, it asks me if I want to run the file.

If I say yes imediatly, then I get this error after about 20 seconds.
--------------------8<--------------------
[Window Title]
Network Error

[Main Instruction]
Windows cannot access \\192.168.10.170\VPNUser\shares.exe

[Content]
Check the spelling of the name. Otherwise, there might be a problem with your network. To try to identify and resolve network problems, click Diagnose.

[^] Hide details [Diagnose] [Cancel]

[Expanded Information]
Error code: 0x80070035
The network path was not found.
--------------------8<--------------------

If I wait over 3 seconds before I click Yes then the file runs.

If I select "Don't show again" and yes then I get the error every time.

This means that the network is not set up yet. Therefor put a delay into the script.

So now I I have two lines in the Windows User Connect
e.g.
start timeout /t 30
start \\192.168.10.170\VPNUser\shares.exe

Then it only runs the first line of the script
If I combine the commands onto one line.
e.g.
start timeout /t 30 && start \\192.168.10.170\VPNUser\shares.exe

Then they both run concurrently
I have verified that the script is in place using

./sacli --pfilt <USER_OR_GROUP> UserPropGet

I have changed this by both the GUI and CLI and confirmed that it has been pushed out to the client.
The client asks to run whatever I put into [prop_cli.script.win.user.connect]

Any idears?

TinCanTech
OpenVPN Protagonist
Posts: 11137
Joined: Fri Jun 03, 2016 1:17 pm

Re: Windows User Connect Script not working

Post by TinCanTech » Wed Jun 02, 2021 1:55 pm

You are using OpenVPN Access-Server product ?

TMTI Support
OpenVpn Newbie
Posts: 9
Joined: Mon Oct 30, 2017 2:46 pm

Re: Windows User Connect Script not working

Post by TMTI Support » Mon Jun 07, 2021 10:14 am

TinCanTech wrote:
Wed Jun 02, 2021 1:55 pm
You are using OpenVPN Access-Server product ?
Yes, the latest client has 1/2 resolved the problem, enough for a work around

chilinux
OpenVPN Power User
Posts: 156
Joined: Thu Mar 28, 2013 8:31 am

Re: Windows User Connect Script not working

Post by chilinux » Mon Jun 07, 2021 1:04 pm

Possibly try:

Code: Select all

start powershell start-sleep -s 30 ; start-process \\192.168.10.170\VPNUser\shares.exe

TMTI Support
OpenVpn Newbie
Posts: 9
Joined: Mon Oct 30, 2017 2:46 pm

Re: Windows User Connect Script not working

Post by TMTI Support » Mon Jun 14, 2021 2:15 pm

I was a bug in the client which they 1/2 fixed in the latest release 3.3.0 (2171)
It would work in the admin section but not in the user section.
I now have it working using this in the Windows User Connect script

Code: Select all

Timeout.exe /T 10 && start %LOGONSERVER%.local.domain.net\NETLOGON\VPN_User\startup.%USERNAME%.bat
It still does not do multi lines

Post Reply