Skip to main content
AAguilo
Explorer
April 19, 2022
Solved

Run a Powershell script on Forticlient vpn connection

  • April 19, 2022
  • 1 reply
  • 15366 views

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

Best answer by Debbie_FTNT

Hey AAguilo,

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

Debbie_FTNT_0-1650614503523.png

1 reply

Forticlient_Guru
Visitor III
April 19, 2022

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

 




AAguilo
AAguiloAuthor
Explorer
April 22, 2022

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.

Debbie_FTNT
Staff & Editor
Staff & Editor
April 22, 2022

Hey AAguilo,

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

Debbie_FTNT_0-1650614503523.png