Posted on 03-06-2021 02:33 AM
I need some help and guidance with the cleanup of the Outlook and Teams caching. Sometimes it is needed to delete those. So i made a script and want to publish is througt the selfservice App. So if our servicedesk advices someone to delete the cache, it can be done by the user. However, my scripting is not that great.
I want to present a popup with 3 choices to the user. Clear Outlook cache, clear Teams cache or quit. The latter one if the user is curious :-)
This is what i have so far but it errors out. What am i doing wrong or is there a better solution to this problem?
#!/bin/bash
#
#
# Clean up script!
#
# Task - Clear outlook address cache list!
# Task - Clear Teams caching!
#
#
#echo on if needed
#set -x
SURETY="$(osascript -e 'display dialog "Delete the cache files?" buttons {"Teams", "Outlook", "Cancel"} default button "Cancel" with icon stop')"
if [ "$SURETY" = "button returned:Outlook" ]; then
echo "Fine, let's delete some Outlook caching."
cd ~/Library/Group Containers/
find . -name "*.olk15RecentAddresses" -type f|xargs rm -f
fi
else if [ "$SURETY" = "button returned:Teams" ]; then
echo "Fine, let's delete some Teams caching."
rm -rf ~/Library/Caches/com.microsoft.teams
rm -rf ~/Library/Application Support/Microsoft/Teams/Application Cache/Cache
rm -rf ~/Library/Application Support/Microsoft/Teams/blob_storage
rm -rf ~/Library/Application Support/Microsoft/Teams/Cache
rm -rf ~/Library/Application Support/Microsoft/Teams/databases
rm -rf ~/Library/Application Support/Microsoft/Teams/GPUCache
rm -rf ~/Library/Application Support/Microsoft/Teams/IndexedDB
rm -rf ~/Library/Application Support/Microsoft/Teams/Local Storage
rm -rf ~/Library/Application Support/Microsoft/Teams/tmp
end if
else if [ "$SURETY" = "button returned:Cancel" ]; then
echo "Nothing to do, let's quit."
end if
# Exit
exit 0
```
Solved! Go to Solution.
Posted on 03-06-2021 10:51 AM
You might want to check out https://office-reset.com/macadmins
Thanks, Paul.
Posted on 03-06-2021 10:51 AM
You might want to check out https://office-reset.com/macadmins
Thanks, Paul.
Posted on 03-07-2021 11:51 PM
Best IT Support tool ;-)
Posted on 03-08-2021 03:25 AM
+1 for @pbowden and Office Reset. Its helped a few users in our environment.
Posted on 03-10-2021 01:03 AM
Really magnificent tool! Thank´s a lot!