Skip to main content
CfSi_Dan
New Member
February 4, 2009
Question

Packaging SSL VPN Client With Custom Scripts

  • February 4, 2009
  • 4 replies
  • 5076 views
Hey All, Does anyone have any ideas on how to deploy the Forticlient SSL VPN with custom scripts that run once the SSL VPN has connected? I' m looking to provide or remote workers to check their workstations in with our AV and patching systems once connected to the corporate LAN.

    4 replies

    red_adair
    New Member
    February 4, 2009
    maybe you want to do it the other way around - Have the script start the SSL-VPN and do whatever it should do. FortiSSLVPNclient.exe /help gives you some directions. -R.
    CfSi_Dan
    CfSi_DanAuthor
    New Member
    February 4, 2009
    Thanks for the suggestion. Right after I posted the original question, I decided to check the .exe for possible command line usage and noticed the switches. connect disconnect [[-h <sslvpn server>][:<port>]] [[-u <sslvpn username>][:<password>]] So now the question is, does anyone know how to create a script that will ask for user input (password) in a dialog, and then pass the collected information to the fortiSSLVPNclient.exe. The SSL VPN server will be hardcoded, and the username will be the %username% system variable. I was looking at the following script example, but need some assistance in getting it to work. I was thinking on using the WshShell.run command, but don' t know how to pass the strPw variable to the command.
    strPw = GetPassword( " Please enter your logon password:"  )    Function GetPassword( myPrompt )  '  This function uses Internet Explorer to  '  create a dialog and prompt for a password.  '   '  Argument:   [string] prompt text, e.g. " Please enter password:"   '  Returns:    [string] the password typed in the dialog screen  '   '  Written by Rob van der Woude  '  http://www.robvanderwoude.com      Dim objIE      '  Create an IE object      Set objIE = CreateObject( " InternetExplorer.Application"  )      '  specify some of the IE window' s settings      objIE.Navigate " about:blank"       objIE.Document.Title = " SSL VPN Password"       objIE.ToolBar        = False      objIE.Resizable      = False      objIE.StatusBar      = False      objIE.Width          = 320      objIE.Height         = 180      '  Center the dialog window on the screen      With objIE.Document.ParentWindow.Screen          objIE.Left = (.AvailWidth  - objIE.Width ) \ 2          objIE.Top  = (.Availheight - objIE.Height) \ 2      End With      '  Wait till IE is ready      Do While objIE.Busy          WScript.Sleep 200      Loop      '  Insert the HTML code to prompt for a password      objIE.Document.Body.InnerHTML = " <DIV align=" " center" " ><P>"  & myPrompt _                                    & " </P>"  & vbCrLf _                                    & " <P><INPUT TYPE=" " password" "  SIZE=" " 20" "  "  _                                    & " ID=" " Password" " ></P>"  & vbCrLf _                                    & " <P><INPUT TYPE=" " hidden" "  ID=" " OK" "  "  _                                    & " NAME=" " OK" "  VALUE=" " 0" " >"  _                                    & " <INPUT TYPE=" " submit" "  VALUE=" "  OK " "  "  _                                    & " OnClick=" " VBScript:OK.Value=1" " ></P></DIV>"       '  Make the window visible      objIE.Visible = True      '  Wait till the OK button has been clicked      Do While objIE.Document.All.OK.Value = 0          WScript.Sleep 200      Loop      '  Read the password from the dialog window      GetPassword = objIE.Document.All.Password.Value      '  Close and release the object      objIE.Quit      Set objIE = Nothing  End Function
    CfSi_Dan
    CfSi_DanAuthor
    New Member
    February 9, 2009
    Does anyone currently run any scripts after the SSL VPN client is connected? I' m having issues with getting my scripts to run, as the SSLVPN .exe does not terminate while its connected. Because it does not terminate, I cannot run any other scripts after the connection is established.
    jperedo
    New Member
    March 4, 2024

    Hi, I'm looking for a solution like the one you implemented... but I have some doubts. 1.- What version of VPN client to use for that 2.- With that solution you could ensure that the user could not deactivate the custom scripts that you configured Thank you