Fortinet Document Library

Version:

Version:

Version:

Version:

Version:


Table of Contents

Windows

This feature supports auto-running a user-defined script after the configured VPN tunnel is connected or disconnected. The scripts are batch scripts in Windows and shell scripts in macOS. They are defined as part of a VPN tunnel configuration on FortiGate's XML format endpoint profile. The profile is pushed to FortiClient from FortiGate. When FortiClient's VPN tunnel is connected or disconnected, the respective script defined under that tunnel is executed. These scripts can also be configured directly on FortiClient by importing the XML configuration file.

Mapping a network drive after tunnel connection

The script maps a network drive and copies some files after the tunnel connects.

<on_connect>

<script>

<os>windows</os>

<script>

<script>

<![CDATA[

net use x: \\192.168.10.3\ftpshare /user:Honey Boo Boo

md c:\test

copy x:\PDF\*.* c:\test

]]>

</script>

</script>

</script>

</on_connect>

Deleting a network drive after the tunnel disconnects

The script deletes the network drive after the tunnel disconnects.

<on_disconnect>

<script>

<os>windows</os>

<script>

<script>

<![CDATA[

net use x: /DELETE

]]>

</script>

</script>

</script>

</on_disconnect>

Windows

This feature supports auto-running a user-defined script after the configured VPN tunnel is connected or disconnected. The scripts are batch scripts in Windows and shell scripts in macOS. They are defined as part of a VPN tunnel configuration on FortiGate's XML format endpoint profile. The profile is pushed to FortiClient from FortiGate. When FortiClient's VPN tunnel is connected or disconnected, the respective script defined under that tunnel is executed. These scripts can also be configured directly on FortiClient by importing the XML configuration file.

Mapping a network drive after tunnel connection

The script maps a network drive and copies some files after the tunnel connects.

<on_connect>

<script>

<os>windows</os>

<script>

<script>

<![CDATA[

net use x: \\192.168.10.3\ftpshare /user:Honey Boo Boo

md c:\test

copy x:\PDF\*.* c:\test

]]>

</script>

</script>

</script>

</on_connect>

Deleting a network drive after the tunnel disconnects

The script deletes the network drive after the tunnel disconnects.

<on_disconnect>

<script>

<os>windows</os>

<script>

<script>

<![CDATA[

net use x: /DELETE

]]>

</script>

</script>

</script>

</on_disconnect>