Hi folks,
I am using the Auto-connect feature with my FortiClient, but I find that the VPN still connects when I am in the office. Ideally, I want the VPN to auto-connect if there is no route available to the file server. If it can connect to the file server (either on the local LAN or through the site-to-site VPN from my other office) then the FortiClient shouldn't connect the VPN.
Any ideas how to achieve this?
Many thanks in advance for your help.
Tim.
Hi folks,
FYI, I have written my own vbscript to do this which I'm happy to share.
Essentially, my solution was as follows:
[ul]Script as follows:
Dim host host = "10.0.0.1" Set WshShell = WScript.CreateObject("WScript.Shell") Ping = WshShell.Run("ping -n 1 " & host, 0, True) Select Case Ping Case 0 ' LAN is contactable, do nothing. Case 1 ' LAN is NOT contactable, restart scheduler.exe to connect VPN. Dim oShell : Set oShell = CreateObject("WScript.Shell") oShell.Run "%COMSPEC% /k taskkill /f /im scheduler.exe", 2, False End Select
The only problem I have left is that killing the scheduler process leaves a FortiClient icon in the systray that doesn't disappear until you mouse over it. If anyone knows how to deal with that, let me know.
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1747 | |
1114 | |
764 | |
447 | |
241 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2025 Fortinet, Inc. All Rights Reserved.