I need to script the uninstall of CrowdStrike on Macs. While deploying CrowdStrike this past week, I realized that we may need to push out a policy or make one available in Self Service to uninstall the software. The uninstall command to do this is:
sudo /Applications/Falcon.app/Contents/Resources/falconctl uninstall --MANAGMENT TOKEN
This command would work perfectly in a script. The issue we have ran into is that using this command sometimes fails. We have not yet gotten a solution from CrowdStrike. The other command that will uninstall the software is:
sudo /Applications/Falcon.app/Contents/Resources/falconctl uninstall -t
Upon entering that command, we are prompted to enter the management token. The prompt is:
Falcon Management Token:
I remember several years ago working with some scripts that would respond to password prompts and enter the password needed. Unfortunately, I didn't write those scripts and I don't have them on hand to modify. Does anyone know how to script this so that the management token can be entered by the script when prompted? I'm going to try a few things today but I wanted to post this here to find out if anyone can point me in the right direction. If the first command that includes the token would work reliably, this would be easy to write. The most reliable command is the second one that results in us being prompted to enter the management token.