Posted on 11-18-2019 10:18 AM
Looking for the best way to create a policy to remove Skype for Business from all Macs in our environment.
Posted on 11-18-2019 10:27 AM
@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
Posted on 11-18-2019 12:47 PM
@sdagley Thank you, this is exactly what I was looking for.
Posted on 11-18-2019 01:12 PM
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
Posted on 11-18-2019 01:18 PM
@r... If you put a code block tag (the triple back-tick - ```) before and after your script it won't be mangled when displayed
Posted on 11-18-2019 04:54 PM
What about killing the process with Restricted Software and doing an app removal if someone tries to execute it? - Just throwing ideas out there :)