update
this did not work properly
************************************************
i ended up using this VBS script .. ran it remotely on all the domain computers
on error resume next
'Uninstall All Version of RemoveTeamViewer
'=============================
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
'Get the OS architecture
'=======================
Err.Clear
checkOSArch = WshShell.RegRead("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\PROCESSOR_ARCHITECTURE")
returnValue = 0
'Wscript.Echo checkOSArch
if Err Then
Err.Clear
'WScript.Echo "The OS Architecture is unable to find ,so it was assumed to be 32 bit"
else
if checkOSArch = "x86" Then
'Wscript.Echo "The OS Architecture is 32 bit"
strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
returnValue = RemoveTeamViewer (strKeyPath)
else
'Wscript.Echo "The OS Architecture is 64 bit"
strKeyPath64 = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
returnValue = RemoveTeamViewer (strKeyPath64)
strKeyPath86 = "SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall"
returnValue = RemoveTeamViewer (strKeyPath86)
End IF
End If
Wscript.Quit returnValue
'===============================================================
'Script to Iterate the Uninstall Resistry Key and remove the Java
'===============================================================
Function RemoveTeamViewer(KeyPath)
On error resume next
Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")
set shell = CreateObject("WScript.Shell")
objReg.EnumKey HKEY_LOCAL_MACHINE, KeyPath, arrSubKeys
For Each Subkey in arrSubKeys
str1 = "HKEY_LOCAL_MACHINE\"&KeyPath &"\"&Subkey &"\DisplayName"
str2 = WshShell.RegRead(str1)
'Wscript.Echo str2
if InStr (str2,"TeamViewer") <> 0 then
'Wscript.Echo str2 & " -- > "& InStr (str2,"TeamViewer")
str3 = "HKEY_LOCAL_MACHINE\"&KeyPath &"\"&Subkey &"\UninstallString"
uninstallStr = WshShell.RegRead(str3)
returnValue =WshShell.Run(Chr(34)& uninstallStr & Chr(34) & " /S ",0,TRUE)
Wscript.Echo uninstallStr & " /S" & returnValue
end if
Next
End Function