Advanced Features : Scripting : Configuring scripts
 
Configuring scripts
To configure, import, export, or run scripts, browse to the Device Manager tab, expand an ADOM view in the tree menu, and then select Script > Script. The script list for the selected ADOM will be displayed.
Figure 175: Script list
Run a script
To run a script:
1. Browse to the ADOM script list for the ADOM that contains the script you would like to run.
2. Select the script, then right-click and select Run from the pop-up menu.
The Execute Script dialog box will open. This dialog box will vary depending on the script target. You will either be able to select a device or devices (left image below), or a policy package (right image). See “Override Script Target” for more information.
Figure 176: Execute Script dialog boxes
3. Select OK to run the script.
The Run Script dialog box will open, showing the progress of the operation and providing information on its success or failure.
Figure 177: Run Script dialog box
4. Selecting the Details option will expand the dialog box to show the details table, with details of the success or failure of the script.
Under the History column in the details table, you can select the History icon to open the script history for that device, and the View Script Execution History icon to view the script execution history for that device.
5. Close the Run Script dialog box when finished.
Add a script
To add a script to an ADOM:
1. Browse to the ADOM script list for the ADOM in which you will be creating the script.
2. Select Create New, or right-click anywhere in the script list and select New from the pop-up menu, to open the Create Script dialog box.
Figure 178: Create a new script
3. Enter the required information to create your new script.
Script Name
Enter a name for the script.
View Sample Script
Select this link to view sample scripts.
Description
Optionally, enter a description of your script.
Script Detail
Enter the script itself, either manually using a keyboard, or by copying and pasting from another editor.
Override Script Target
Select to change the script target. This settings will affect the options presented when you go to run a script. The options include:
Run on FortiGate Directly (via CLI)
Run on Policy Package, ADOM Database or Global Policy
Run on DB (default).
Advanced Device Filter
Select to adjust the advanced filters for the script. The options include:
OS Type (select from the drop-down list)
OS Version (select from the drop-down list)
Platform (select from the drop-down list)
Build
Device (select from the drop-down list)
Hostname
Serial No.
4. Select OK to create the new script.