Skip to content

Instantly share code, notes, and snippets.

@onuratci
Created May 20, 2020 10:39
Show Gist options
  • Select an option

  • Save onuratci/c6193928fb4d0ecd11bf9df0c63f44c4 to your computer and use it in GitHub Desktop.

Select an option

Save onuratci/c6193928fb4d0ecd11bf9df0c63f44c4 to your computer and use it in GitHub Desktop.

Revisions

  1. onuratci created this gist May 20, 2020.
    45 changes: 45 additions & 0 deletions skype-for-business-uninstall.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    #!/bin/sh

    # Pull current logged in user into 'user' variable.
    user=`ls -l /dev/console | cut -d " " -f 4`

    # #2 Kill Lync & SfB
    killall "Microsoft Lync"
    killall "Skype for Business"

    # #3 Delete the Lync & SfB applications
    rm -rf /Applications/Microsoft\ Lync.app
    rm -rf /Applications/Skype\ For\ Business.app

    # #4 Delete caches, cookies, OC_KeyContainer, preferences, receipts & logs (if present)
    rm -rf /Users/$user/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.lync.sfl
    rm -rf /Users/$user/Library/Cookies/com.microsoft.Lync.binarycookies
    rm -rf /Users/$user/Library/Caches/com.microsoft.Lync
    rm -rf /Users/$user/Library/Group\ Containers/UBF8T346G9.Office/Lync
    rm -rf /Users/$user/Library/Logs/Microsoft-Lync*
    rm -rf /Users/$user/Library/Preferences/ByHost/MicrosoftLync*
    rm -rf /Users/$user/Library/Preferences/com.microsoft.Lync.plist
    rm -rf /Users/$user/Library/Receipts/Lync.Client.Plugin.plist
    rm -rf /Users/$user/Library/Keychains/OC_KeyContainer*

    rm -rf /Users/$user/Library/Preferences/com.microsoft.SkypeForBusinessTAP.plist
    rm -rf /Users/$user/Library/Logs/com.microsoft.SkypeForBusinessTAP
    rm -rf /Users/$user/Library/Application\ Support/Skype\ for\ Business
    rm -rf /Users/$user/Library/Application\ Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.microsoft.skypeforbusinesstap.sfl
    rm -rf /Users/$user/Library/Application\ Support/com.microsoft.SkypeForBusinessTAP
    rm -rf /Users/$user/Library/Cookies/com.microsoft.SkypeForBusinessTAP.binarycookies

    # #5 Delete Lync & Skype User Data (but keep Lync Conversation History)
    rm -rf /Users/$user/Documents/Microsoft\ User\ Data/Microsoft\ Lync\ Data
    rm -rf /Users/$user/Documents/Microsoft\ User\ Data/Microsoft/Communicator

    # #6 remove this file from the Keychains folder and therefore, the Keychain
    rm /Users/$user/Library/Keychains/OC_KeyContainer*

    # #7 Delete the following KeyChain entry using security command
    # $user variable is still in place from earlier

    # Pull current logged in user's e-mail address into 'userEmail' variable.
    userEmail=$(dscl . -read /Users/$user EMailAddress | cut -f2 -d":" | cut -f2 -d" ")
    security delete-certificate -c $userEmail /Users/$user/Library/Keychains/login.keychain
    security delete-generic-password -l "OC_KeyContainer*" /Users/$user/Library/Keychains/login.keychain