Skip to main content
AAguilo
Explorer
Apr 19, 2022 2:32 PM UTC
Solved

Run a Powershell script on Forticlient vpn connection

Hi,

In my company we are using IP ranges that may conflict to the ones the client user is using while teleworking from home (192.168...)

 

The users are connecting to VPN using Forticlient. I would like to identify the connection/disconnection event so when the user connects to the vpn it runs a script to update his local routing tables to avoid conflicts, and when it disconnects, it restore them back. 

 

Is there a way to automate this script running from Fortigate/Forticlient itself? If not, Is there any event log or some way to trigger the scripts.

 

Thanks,

Albert

Debbie_FTNT
Staff & Editor
Apr 22, 2022 8:01 AM UTC

Hey AAguilo,

that option only exists with EMS server, not on FortiGate itself.

Debbie_FTNT_0-1650614503523.png

4 replies

Forticlient_Guru
Visitor III
Apr 19, 2022 2:54 PM UTC

Hi 

I believe you can do by editing  in VPN profile >> with on connect script (you can use batch script to call your powershell etc) 

Forticlient_Guru_0-1650379997430.png

 




Translate
AAguilo
AAguiloAuthor
Explorer
Apr 22, 2022 6:06 AM UTC

Hi,

Thanks for your reply. Where can I find this VPN profile menu? I have Fortigate 40F v6.4.8. I've checked everywhere and i can't seem to find it.

Translate
Debbie_FTNT
Staff & Editor
Staff & Editor
Apr 22, 2022 8:01 AM UTC

Hey AAguilo,

that option only exists with EMS server, not on FortiGate itself.

Debbie_FTNT_0-1650614503523.png

Translate
Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024