Sample scripts when deploying GoTo for Teams to multiple computers
Below you will find a collection of scripts that IT administrators may find useful in managing the GoTo for Teams desktop plugin. These sample scripts facilitate tasks that are not performed automatically by installers, Group Policies, or otherwise. IT administrators can manually integrate them into their scripts if they need to perform these tasks.
Sections in this article:
- Uninstall GoTo for Teams desktop plugin per-user installation (Windows)
- Clean up user profiles (Windows and Mac)
Uninstall GoTo for Teams desktop plugin per-user installation (Windows)
This script can be used to uninstall the GoTo for Teams desktop plugin for the current user. It works on per-user installations only. It should be executed from the user context for each user profile, for which the app needs to be uninstalled.
<#
.SYNOPSIS
This script checks if the GoTo for Teams desktop plugin is installed for the current user and, if so, uninstalls it silently.
.DESCRIPTION
The script checks if the app is running and stops it if so.
It then reads the uninstall command line from the "QuietUninstallString" entry under the "Uninstall" key
for the GoTo for Teams desktop plugin and executes it.
#>
$ErrorActionPreference = "Stop"
Function Stop-App {
Param (
[Parameter(Mandatory)][String]$AppName
)
# Close the app, if running.
$AppProcesses = Get-Process -Name $AppName -ErrorAction SilentlyContinue
if ($AppProcesses) {
Write-Host "Stopping $AppName..."
Stop-Process -Name $AppName -Force
# Wait a bit
Start-Sleep -Seconds 5
} else {
Write-Host "$AppName is not running"
}
# Check that the app is not still running
$AppProcesses = Get-Process -Name $AppName -ErrorAction SilentlyContinue
if ($AppProcesses) {
Write-Host "$AppName is still running, aborting"
Exit 1
}
}
# Make sure the GoTo for Teams desktop plugin is not running
Stop-App -AppName GoToForTeams
# Read the QuietUninstallString
try {
$UninstStr = Get-ItemPropertyValue -LiteralPath "HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\fe1ed928-c24c-418c-87f5-8a9fa9102d61" -Name "QuietUninstallString"
} catch {
$UninstStr = $null
}
if ($UninstStr) {
# Optionally, preserve the user profile
# $UninstStr = "$UninstStr --KeepProfile"
Write-Host "Found GoTo for Teams desktop plugin installed, uninstalling using command: $UninstStr"
# Uninstall app
$Process = Start-Process -FilePath "$Env:ComSpec" -ArgumentList "/c $UninstStr" -PassThru
$Process.WaitForExit()
Write-Host "Done"
} else {
Write-Host "GoTo for Teams desktop plugin is not installed"
}
Clean up user profiles (Windows and Mac)
This script can be used to clean up the user profile used by the GoTo for Teams desktop plugin after the app is uninstalled. The user profile items to clean up are the same regardless of whether GoTo for Teams desktop plugin was installed per machine or per user, but normally this script is useful to clean up after per-machine uninstall. This is because uninstalling the MSI for per-machine installation does not clean up the user profiles, while the per-user uninstall cleans up the user profile as part of the uninstallation.
The script should be executed from the user context for each user, for which the profile needs to be cleaned up.
Windows
REM Delete the app registry key
REG DELETE HKEY_CURRENT_USER\Software\LogMeInInc\GoToForTeams /f
REM Delete the auto-start setting
REG DELETE HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run /v "GoTo for Teams plugin" /f
REM Delete the app data folder
RMDIR /S /Q "%APPDATA%\GoTo for Teams plugin"
Mac
# Delete the plist
rm -f ~/Library/Preferences/com.logmein.gotoforteams.plist
# Delete the app data folder
rm -rf ~/Library/Application\ Support/GoTo\ for\ Teams\ plugin