Jtracy_ItPro

WebEx_Teams_x64-Uninstall_AllUsers.ps1

Sep 18th, 2020 (edited)
1,322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Universal MSI uninstaller for Cisco Teams x64 - Full system Install
  2. # This is weird because the app is designed to be uninstalled per-user.
  3. # This script only helps if you installed for SYSTEM instead.
  4. # Still supported anyway.
  5. # - JT
  6.  
  7. $AppName = "Webex Teams"
  8.  
  9. # Sweep installed apps and pull the uninstall string.
  10. # This is meant to solve the problem of uninstalling auto-patched apps. with automation.
  11. # Secunia will auto-apply new MSIs, which changes the string.
  12. # The config manager client can uninstall with this script, with no regard to the version that's actually installed.
  13.  
  14.  
  15. ##################################################################
  16.  
  17. # Kill processes.
  18.  
  19. $ProcessNames = @("CiscoCollabHost","CiscoCollabHostCef")
  20.  
  21. Get-Process | ? {$_.name -in $ProcessNames} | % {$_ | Stop-Process -Force -Verbose}
  22.  
  23. #######################################################
  24.  
  25. ## Look for the correct architecture.
  26.  
  27. #$UninstallRoot = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
  28.  
  29. $UninstallRoot = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
  30.  
  31. # Find the first app which matches the name. Be careful to make it find the corret one, in case more than one app matches.
  32.  
  33. # ! ! ! no wildcards this time.
  34.  
  35. $AppInfo = Get-ChildItem -Path $UninstallRoot | Where-Object {$_.getValue("DisplayName") -eq ($AppName)} | Select-Object -First 1
  36.  
  37. # !!!! No detailed info here. No version etc. Just name and guid.
  38.  
  39. #$Version = $AppInfo.GetValue("DisplayVersion")
  40.  
  41. $LogFile = $env:TEMP + $AppName + "-Uninstall.log"
  42.  
  43. $AppGuid = $AppInfo.PSChildName
  44.  
  45. # With all this information, run the uninstall command.
  46.  
  47. & MsiExec /x $AppGuid /q /norestart /log $LogFile | Wait-Process
  48.  
  49.  
Add Comment
Please, Sign In to add comment