FortiClient
FortiClient proactively defends against advanced attacks. Its tight integration with the Security Fabric enables policy-based automation to contain threats and control outbreaks. FortiClient is compatible with Fabric-Ready partners to further strengthen enterprises’ security posture.
Sgagan
Staff
Staff
Article Id 277070
Description This article describes a scenario to uninstall FortiClient completely from macOS using a script.
Scope FortiClient.
Solution

This script will uninstall FortiClient if it was installed via the standard macOS package installer (PKG) method.

 

  1. Open a text editor (e.g., TextEdit) and create a new document.
  2. Add the following script to the document:

 

Sgagan_0-1696266282891.png

 

Script:


#!/bin/sh
# Uninstall FortiClient.sh
| uninstall_forticlient.sh
# This script will completely uninstall FortiClient and all supporting components
pkill FortiClientAgent
launchctl unload /Library/LaunchDaemons/com.fortinet*
rm -Rfv /Applications/FortiClient.app
rm -Rfv /Applications/FortiClient Uninstaller.app
rm -Rfy /Library/Application Support/Fortinet
rm -Rfy /Library/Internet
Plug-Ins/FortiClient_SSLVPN_Plugin.bundle
rm -Rfy/Library/LaunchDaemons/com.fortinet.f forticlient.vpn.plist' rm -Rfy /Library/LaunchDaemons/com.fortinet.forticlient,
rm -Rfv
'/Library/LaunchDaemons/com.fortinet.fortic
plist'
.fssoagent launchdaemon.plist'
rm -Rfy /Library/LaunchDaemons/com.fortinet.forticlient.epctrl.plist' rm -Rfv '/Library/LaunchDaemons/com.fortinet.forticlie
rm -Rfv '/Library/LaunchDaemons/com.fortinet.forticl
localAccounts=$(dscl. list /Users UniqueID | awk '$2 > 500 print $1}')
for user in $localAccounts;
do
rm -Rfy /Users/"$user"/Library/Application Support/Fortinet/ done

 

 

  1. Save the document with a .sh extension, for example, 'uninstall_forticlient.sh'. Note that If it does not allow to save with .sh, try to save the .rtf extension first and later change to .sh by renaming it.
  2. Open Terminal on the Mac.
  3. Navigate to the folder where the script is saved, using the ‘cd’ command. For example, if it is saved on the Desktop, navigate there using:
Sgagan_1-1696266282894.png

 

  1. Make the script executable:

 

Sgagan_2-1696266282894.png

 

  1. Run the script with sudo privileges to uninstall FortiClient:

 

Sgagan_3-1696266282895.png

 

It will be possible to enter the admin password to execute the script with sudo.

 

This script will locate and remove FortiClient application files and related configuration files.

Use it with caution and ensure to have a backup of any important data or configurations associated with FortiClient before running the script.

Contributors