Skype removal

cpruitt
New Contributor

Looking for the best way to create a policy to remove Skype for Business from all Macs in our environment.

5 REPLIES 5

sdagley
Esteemed Contributor II

@cpruitt You might find this MS document helpful as the basis of writing a removal script: How to do a clean uninstallation of Skype for Business on Mac

cpruitt
New Contributor

@sdagley Thank you, this is exactly what I was looking for.

r___
New Contributor III

Feel free to use this as a jump point. I normally remove the basic user folders since this app gets reinstalled a lot but you can add the rest of the folders if needed.

#!/bin/sh

consoleuser=$(ls -l /dev/console | awk '{ print $3 }')

echo "logged in user is" $consoleuser

pkill -f Skype

security delete-generic-password -l "Skype for Business" /Users/$consoleuser/Library/Keychains/login.keychain

folders=(
"/Applications/Skype for Business.app"
"/Library/Internet Plug-Ins/MeetingJoinPlugin.plugin"
#
"/Users/$consoleuser/Library/Containers/com.microsoft.SkypeForBusiness"
"/Users/$consoleuser/Library/Logs/LwaTracing"
"/Users/$consoleuser/Library/Saved Application State/com.microsoft.SkypeForBusiness.savedState"
"/Users/$consoleuser/Library/Preferences/com.microsoft.SkypeForBusiness.plist"
)

search="*"


for i in "${folders[@]}"
do
    echo "removing folder ${i}"
    rm -rf "${i}"
done

if [ $? == 0 ]; then
     echo "Success"
else
     echo "Failure"
fi

sdagley
Esteemed Contributor II

@r... If you put a code block tag (the triple back-tick - ```) before and after your script it won't be mangled when displayed

see
New Contributor III
New Contributor III

What about killing the process with Restricted Software and doing an app removal if someone tries to execute it? - Just throwing ideas out there :)