TeamViewer is an application installed on MacOS computers (among others operating systems) that allows users to connect to remote computers for collaboration or support activities.
When this application is no longer needed, it could be uninstalled from devices and this can be done with a script.
To confirm the location path of the software, the folder /Applications can be checked, and the TeamViewer.app application should be listed.
To execute the Uninstall Command, a script can be created, under Scripting | Scripts | Choose Action | New and a new script configuration option will open.
To configure the script, following information may be used:
Selecting "All Devices" or specific devices (for Name, Labels or Operating Systems) will determine the target computers to uninstall the software.
If a notification popup is required then the "User Notify" section will provide the means to that end.
Suggested options to let the script run if there is "no logged-in user" or "Run on next connection if offline" if the device is unreachable.
To let the script be executed at a specific time, the "Schedule" option would be used to specify when to uninstall the software.
To remove the application, there are five commands that must be executed to clear the information.
To remove the application:
rm -rf /Applications/TeamViewer.appTo remove the Launch Agents:
rm -f /Library/LaunchAgents/com.teamviewer*To remove the Launch Deamons:
rm -f /Library/LaunchDaemons/com.teamviewer*To remove the Preferences file:
rm -f /Library/Preferences/com.teamviewer*To remove the Privileged Helper Tool file:
rm -f /Library/PrivilegedHelperTools/com.teamviewer*
This task can be accomplished using five commands in one task for the script:
The configuration of every step should be as follows:
1. Launch a program to remove the application file:
Directory: /bin
File: rm
Wait for completion: Checked.
Visible: Unchecked.Parameters: -rf /Library/TeamViewer.app
2. Launch a program to remove the Launch Agents file:
Directory: /bin
File: rm
Wait for completion: Checked.
Visible: Unchecked.
Parameters: -f /Library/LaunchAgents/com.teamviewer*
3. Launch a program to remove the Launch Daemons file:
Directory: /bin
File: rm
Wait for completion: Checked.
Visible: Unchecked.
Parameters: -f /Library/LaunchDaemons/com.teamviewer*
4. Launch a program to remove the Preferences file:
Directory: /bin
File: rm
Wait for completion: Checked.
Visible: Unchecked.
Parameters: -f /Library/Preferences/com.teamviewer*
5. Launch a program to remove the Privileged Helper Tool file:
Directory: /bin
File: rm
Wait for completion: Checked.
Visible: Unchecked.
Parameters: -f /Library/PrivilegedHelperTools/com.teamviewer*
After every step, a new one can be added to show a window with the progress, the attached script shows an example with this.
Saving the changes will deploy the script and uninstall the software when the script runs.
Also, the attached package (Script-189) may be imported as a resource to the Appliance and all this configuration will be already in place.
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center