Skip to content

Instantly share code, notes, and snippets.

@ak9999
Last active August 1, 2026 03:19
Show Gist options
  • Select an option

  • Save ak9999/e68da02d7957bd7db2a2a647f76d50be to your computer and use it in GitHub Desktop.

Select an option

Save ak9999/e68da02d7957bd7db2a2a647f76d50be to your computer and use it in GitHub Desktop.
Uninstall LabTech and ScreenConnect Agents: For those who are having a hard time uninstalling the LabTech Agent from their computer, the first script will remove the LabTech Agent, and the second will remove ScreenConnect aka (ConnectWise Control).

Comments are disabled due to abuse.

Someone posted a phishing link in the comments to malware, I've deleted the comment, and I'm disabling comments to prevent further attempts at abuse.

Why I wrote this

At the time that I wrote these scripts, I was trying to clean up old agents that would not uninstall, did not show up under Win32_Product queries, didn’t have clean registry entries.

If you are a subscriber to ConnectWise Automate, go to the link in your Automate interface for the agent uninstaller and compare it to the one in the script above, that should resolve any doubts you may have regarding the legitimacy of the download link. I know it’s frustrating to trust a “random URL”, but that’s how you can verify it.

I haven’t used ConnectWise Automate in years, I just left this up here to help others.

$url = "https://s3.amazonaws.com/assets-cp/assets/Agent_Uninstaller.zip"
$output = "C:\Windows\Temp\Agent_Uninstaller.zip"
(New-Object System.Net.WebClient).DownloadFile($url, $output)
# The below usage of Expand-Archive is only possible with PowerShell 5.0+
# Expand-Archive -LiteralPath C:\Windows\Temp\Agent_Uninstaller.zip -DestinationPath C:\Windows\Temp\LTAgentUninstaller -Force
# Use .NET instead
[System.Reflection.Assembly]::LoadWithPartialName("System.IO.Compression.FileSystem") | Out-Null
# Now we can expand the archive
[System.IO.Compression.ZipFile]::ExtractToDirectory('C:\Windows\Temp\Agent_Uninstaller.zip', 'C:\Windows\Temp\LTAgentUninstaller')
Start-Process -FilePath "C:\Windows\Temp\LTAgentUninstaller\Agent_Uninstall.exe"
wmic product where "name like 'ScreenConnect Client%%'" call uninstall /nointeractive

Comments are disabled for this gist.