Skip to main content
cysaw
Staff & Editor
Staff & Editor
July 7, 2026

Troubleshooting Tip: How to collect monitoring log from FortiMail using the powershell script

  • July 7, 2026
  • 0 replies
  • 31 views

Description

This article describes how to collect monitoring logs from FortiMail using the PowerShell script.

Scope

FortiMail.

Solution

Note: To deploy the attached PowerShell script, it is required to modify the content of the script under $hostname, $username, and $password to match the local FortiMail IP and credentials.

  1. Install the module in PowerShell using Administrator rights:

Install-Module -Name Posh-SSH


  1. Open up the attached PowerShell script file and edit the $hostname, $username, and $password to match the local FortiMail IP and credentials.

    e2bb0f02.png


  2. Configure the duration of the PowerShell script that is required to run.

    1ce82117.png


  3. Add the useful CLI commands to collect the output from FortiMail.

    59c94e43.png


  4. Open the 'Windows PowerShell ISE' with administrator rights, open the PowerShell Script file, and hit the run button to execute the PowerShell script.

    932659a6.png