Worklet: Uninstall TeamViewer on Windows

  • 17 March 2021
  • 3 replies
  • 325 views

Userlevel 4

Hi all, we had a couple machines that had TeamViewer installed and needed to mass uninstall, thought I’d share the Worklet to uninstall this


Evaluation:


if (Test-Path -Path "C:\Program Files (x86)\TeamViewer") 
{
Write-Output "TeamViewer not installed, skipping"
exit 0
}
else
{
Write-Output "TeamViewer installed, we will uninstall"
Exit 1
}

Remediation:


$AllApps = Get-ItemProperty "HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*"
$TeamViewer = $AllApps | Where-Object {$_.DisplayName -Like "TeamViewer*"}
Write-Output "Uninstalling TeamViewer"
Start-Process -FilePath ($TeamViewer.UninstallString) -ArgumentList "/S" -WindowStyle Hidden

3 replies

It does not work for me!

I believe versions prior to 15 did not register as installed in that registry key. I use the following to remove both versions of Full and Client:



#TeamViewer Host Upgrade

Start-Process -FilePath msiexec.exe -ArgumentList “/x {731F6BAA-A986-45A4-8936-7C3AAAAA760B} /qn”

#TeamViewer Full Upgrade

Start-Process -FilePath msiexec.exe -ArgumentList “/x {150798A5-21DE-431E-BDC7-A822769BE9A2} /qn”

#TeamViewer Host

Start-Process -FilePath msiexec.exe -ArgumentList “/x {010C06FC-749F-41C3-9D7D-28C17D673A7A} /qn”

#TeamViewer Full

Start-Process -FilePath msiexec.exe -ArgumentList “/x {2B4FB49C-C477-4EB2-8477-5D95B84E8D5F} /qn”


Badge

Thanks for this post. We actually mass deploy with host (client) but with Covid, we have started to use Full on staff machines to help remote assist our patrons so this helps remove the client (which breaks the link) and will tweak to install the Full version.

Reply