Skip to main content

Huntress Agent (Uninstall) - MAC

Summary

This script uninstalls the Huntress agent from a Mac system.

Create Script

Please create a new "PowerShell" style script to implement this process.

Image
Image

Name: Huntress Agent (Uninstall) - MAC
Description: This script uninstalls the Huntress agent from a Mac system.
Category: Custom

Image

Script

Row 1 Function: Bash Script

Image

Paste the following Bash script and set the expected script execution time to 900 seconds.

Bash Script 1

Image

Step 2 Function: Script Log

  • Add a new row in the If Section of the If/Else part by clicking the Add Row button.
  • Search and select the Script Log function.
  • Input the following:

Bash Script 2

Image
Image

Step 3 Logic: If/Then

  • Add a new If/Then/Else logic from the Add Logic dropdown menu.

Image

Row 3a Condition: Output Contains

  • Type Failed to uninstall Huntress in the Value box.

Image

Row 3b Function: Script Exit

  • Add a new row in the If Section of the If/Else part by clicking the Add Row button.
  • Search and select the Script Exit function.
  • Input the following:

Bash Script 3

Image
Image

Step 4 Function: Script Exit

  • Add a new row in the If Section of the If/Else part by clicking the Add Row button.
  • Search and select the Script Exit function.
  • Leave it blank

Image
Image

Step 5: Complete Script

Image

Script Deployment

For now, the task has been created to run manually on the machines.
Go to Automations > Tasks.
Search for Huntress Agent (Uninstall) - MAC.
Then click on Schedule and provide the necessary parameters for script completion.

Image

Output

  • Script log

Changelog

2025-04-10

  • Initial version of the document