Plesk Utility - CLI

The Plesk command line interface (CLI) is designed for Plesk integration with third-party applications. The root user can use Plesk command line utilities from the console or script. The Plesk CLI does not require the Plesk web interface (also called GUI) to run. Upon successful execution, it returns code 0. If an error occurs, it returns code 1 and displays the description of the problem found in stderr.

Three different form to call cmd command :

  • plesk sbin modules\flex-firewall-manager\ffm <parameters>
  • plesk ext flex-firewall-manager <parameters>
  • %plesk_dir%\admin\bin\modules\flex-firewall-manager\ffm <parameters>

CLI Commands

Command Parameter Description Example
--add <IP>

Add IP address to a rule.

Requires <RULEID>

To add 1.2.3.4 into the SMTP rule:

plesk ext flex-firewall-manager --add 1.2.3.4 SMTP

--remove <IP>

Delete IP address from a rule.

Requires <RULEID>

To remove 1.2.3.4 into the SMTP rule:

plesk ext flex-firewall-manager --remove 1.2.3.4 SMTP

--find <IP>

Find IP address in Firewall or MailEnable rules.

Requires -firewall -mailenable

To search 1.2.3.4 in Firewall:

plesk ext flex-firewall-manager --find 1.2.3.4 -firewall

To search 1.2.3.4 in MailEnable:

plesk ext flex-firewall-manager --find 1.2.3.4 -mailenable

--enable

Enable a rule.

Requires <RULEID>

To enable SMTP rule:

plesk ext flex-firewall-manager --enable SMTP

--disable

Disable a rule

Requires <RULEID>

To disable SMTP rule:

plesk ext flex-firewall-manager --disable SMTP

--list <id | exist>

Show list of available rule or ID.

To get the ListID list:

plesk ext flex-firewall-manager --list id

To get rule names:

plesk ext flex-firewall-manager --list exist

--on <firewall | extension>

Turn on Windows Firewall or Turn on Extension.

To enable Firewall:

plesk ext flex-firewall-manager --on firewall

To enable the Extension:

plesk ext flex-firewall-manager --on extension

--off <firewall | extension>

Turn off Windows Firewall or Disable Extension.

To disable the Firewall:

plesk ext flex-firewall-manager --off firewall

To disable Extension:

plesk ext flex-firewall-manager --off extension

--status <firewall | extension | protection | mailenable | smartermail>

View the status of Windows Firewall, Extension or Protections.

To view the Firewall status:

plesk ext flex-firewall-manager --status firewall

To view the status of the extension:

plesk ext flex-firewall-manager --status extension

To list the status of protections:

plesk ext flex-firewall-manager --status protection

To list the MailEnable status:

plesk ext flex-firewall-manager --status mailenable

To list SmarterMail status:

plesk ext flex-firewall-manager --status smartermail

--protection <modulo>

Change the protection status.

Requires indicating which module you want to change state:
<SMTP | IMAP | POP | FTP | SECURITY | DB | RDP | WEB>

To change the ENABLE/DISABLED status of module SMTP:

plesk ext flex-firewall-manager --protection SMTP

To change the ENABLE/DISABLED status of module RDP:

plesk ext flex-firewall-manager --protection RDP

--whitelist <IP>

Add IP to exception list.

To add IP:

plesk ext flex-firewall-manager --whitelist 1.2.3.4

--help   Shows the available commands.

Command list:

plesk ext flex-firewall-manager --help