20 мая 2016 г.

Lansweeper lspush.exe + openvpn - collect data on connect

The task:
Collect data from mobile computers after connecting into corporate network with openvpn client for windows.
The problem:
Openvpn client wait while "up" script ends. The lansweeper server not available because connection still not established.
How to resolve:
Run script and return control to connection. Run lansweeper client 20 seconds later.
=============================================
1. Use "up" option of openvpn
# connection.ovpn
script-security 2 system
up "c:\\adm\\up.cmd"
=============================================
2. Run vbscript and return to connection without waiting script
rem c:\adm\up.cmd
cscript.exe c:\adm\lspush.vbs
=============================================
Rem c:\adm\lspush.vbs
Set WshShell = WScript.CreateObject("WScript.Shell")
call WshShell.Run("c:\adm\lspush.cmd",0,false)
=============================================
3. Openvpn connection established and lspush.exe runs after timeout, when lansweeper server already availiable.
rem  c:\adm\lspush.cmd
timeout /t 20
c:\adm\lspush.exe my.lansweeper.loc