Issue:
How to perform a silent uninstall of WithSecure Client Security for Mac or Elements Agent for Mac / Elements EPP for Mac?
Resolution:
Before running any uninstall operation, you need to deactivate the system extension. You can use the following command:
<span style="font-family: Courier New,Courier,monospace;">/Applications/WithSecure/WithSecure\ Agent.app/Contents/MacOS/wsagent --deactivate-system-extension</span>
This will deactivate the system extension. It should be run with a user session, or it can also be run without it if there is an MDM profile configured that allows sysext uninstallation. In any case this command should be executed before uninstall_MacProtection script.
You can uninstall Elements Agent for Mac and Client Security for Mac using the command line by running the following command:
<span style="font-family: Courier New,Courier,monospace;">sudo /Library/WithSecure/bin/uninstall_MacProtection</span>
The script needs to run as ”root” so depending on what kind of logon scripts, It may or may not work. A script executed by a remote administration tool such as JAMF or Apple Remote Desktop (or just using SSH) can be run as root so it should work.
Note: If the uninstall_MacProtection uninstallation method fails, it could be that you have in the Elements profile "Allow user to uninstall the product" set as disabled. If the subscription has expired and client settings cannot be changed anymore, then delete the following file to remove the restriction:
<span style="font-family: Courier New,Courier,monospace;">/Library/WithSecure/fsmac/sysconfig/.no_uninstall</span>