According to Microsoft, Lync must be completely uninstalled, following the procedures documented at https://technet.microsoft.com/en-us/library/jj945448(v=office.14).aspx, at least for Calendar functionality to work correctly.
This repo contains a python script for removing all referenced Lync components for all normal users on a machine, i.e., with homes in /Users.
It is somewhat naive in that it assumes the users have not moved the Lync keychain items out of the Login keychain and into some other keychain. It handles the potential for multiple "[email protected]" certificates in the login keychain, however. This is all done by running the security command as a subprocess. Improvements could probably be made to do this all with the Security Framework and the PyObjC bridge, but this gets the job done.
You will need to edit the pattern global APP_PW_PATTERN
at the top of the uninstall_lync.py
script to look for your environment's email domain. Again, this could be made more generic by just building a pattern that accepts all email addresses as part of the OC_KeyContainer__<email address>
construction that Lync uses, but it gets the job done. Feel free to send me a better implementation! If you're of the "get it done" mentality, just edit this pattern to use your domain. Examples are included of how to regex search for multiple email domains as well.
Hey Shea --
Thanks so much for the code sharing. I noticed that it did not delete the package installer receipts out of /var/db/receipts so I added that code as well as code in the installcheck.sh to clean up those systems where this had already ran but had not gotten the receipts.
Unfortunately there is no pull request on gist.github, so if you could take a look at my fork and copy and and paste it in. For the uninstall_lync.py, all of the additions are between the last import command and FILES_TO_REMOVE.