I am trying to get Microsoft Lync uninstalled so that Skype for Business will be our main communication app. I have indexed the package, marked it for uninstallation and even tried using a script to uninstall but Microsoft Lync refuses to go away. Here is the script I tried in conjunction with the policy I created. I have since removed the script. What is the best way to remove a packaged pushed by Casper Remote or a policy? I am missing something?
The # wasn't likely missing from the script. It just needed to be wrapped in the script tags or the boards here interpret it as a header styling. However, pick one shebang! You have two in your script, /bin/sh and /bin/bash. You only need one.
The loop over all accounts that @rqomsiya shows above is what you should use since you can't be sure that only the logged in user has Lync related files in it when the script runs. Best to search and destroy across all accounts, just to be sure you're getting all of it.
Also, you should be aware that while indexing packages and using the uninstall functions is nice, it doesn't always work the way you might expect. Sometimes it leaves stuff behind that a script would catch. Personally I would do it via script.