Skip to main content
Contributor
October 9, 2020

Technical Tip: Execute and deploy a script from the FortiCloud

  • October 9, 2020
  • 0 replies
  • 1922 views

Description

 

This article describes how to execute and deploy a CLI script from FortiGate Cloud.

 

Scope

 

FortiGate Cloud.

Solution

 

CLI command scripts can be configured on FortiGate Cloud to run on managed FortiGates on an ad hoc or scheduled basis.

 

Note:

Running CLI scripts is only available to FortiGates with the FortiGate Cloud Standard Subscription. Refer to Feature Comparison for the available features included with Basic and Standard subscriptions.

 

To create the CLI script:

  1. Log in to FortiGate Cloud.
  2. Select CLI Scripts -> Script List -> Create New.
  3. Enter the CLI commands and select OK to save.

 

The example below shows the CLI commands for enabling management access (SSH, Ping, HTTPS, SNMP) for the port2 interface.

 

Screenshot 2026-03-23 113521.png

 

Screenshot 2026-03-23 114024.png

 

To run the CLI script:

  1. Select CLI Scripts -> Script List -> Runnable Scripts -> Run.

 

Screenshot 2026-03-23 114231.png

 

  1. Select the FortiGate. Only FortiGates with the Standard Subscription will show up in the list.

  • Select Immediate to run the script immediately.
  • Select Scheduled to configure the required time to run the script.

 

Screenshot 2026-03-23 114725.png

 

  1. Log in to the FortiGate GUI to check the changes.

Before executing the script:

 
Screenshot 2026-03-23 115344.png

 

After executing the CLI script:

 
Screenshot 2026-03-23 115444.png

 

For FortiOS CLI command information, refer to FortiOS CLI Reference.