We use the Powershell Application Deployment Toolkit for deploying applications in SCCM. I'm currently working on uninstalling Sophos VPN from machines in a certain collection in our environment.
Here is the uninstall part of the script. The problem is that clients will uninstall Sophos but won't remove the Sophos folder. The detection method is set to that folder, which leads to clients returning 'Removal Failed' errors, even though the program itself uninstalled.
Yes, I googled. There were batch files or small scripts that I really don't want to Frankenstein into the process.
Another part about this is that the way is installed requires you to login and it downloads a user specific (cert configured) .exe file.
Things I've tried
Adding Remove-Folder later in the deployment script. (This didn't really have any impact. )
Changing the Detection Method to the uninstall.exe (the uninstall.exe disappears when it's uninstalled). However, this method for whatever reason led to all the clients I put in the collection to succeed within SCCM without actually uninstalling the program.
Changing the Detection Method to use the registry. This had the same result as the second effort.
Any suggestions or advice?
.
Remove-Folder
a valid Powershell cmdlet? When I runGet-command 'Remove-folder'
I get errors that the cmd-let is not found. Try usingRemove-item
. Take a look here for information and parameters forRemove-Item
.Remove-Folder
function is included with the Powershell Application Deployment Toolkit linked above -- the basis for their question here.