Skip to content

Instantly share code, notes, and snippets.

@ak9999
Created September 21, 2019 23:48
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ak9999/e68da02d7957bd7db2a2a647f76d50be to your computer and use it in GitHub Desktop.
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).
$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
@Beasticle
Copy link

So, I got the script working in my environment, but I was wondering what the AWS link is from. Is it a personal repo or an enterprise one? My main concern is using personal repos in a production environment. Would it be possible to change that from the AWS link to a server share perhaps?

@ak9999
Copy link
Author

ak9999 commented Dec 10, 2021

If you have ConnectWise Automate, when you click to download the agent uninstaller, they give you this link. You can access it whenever you want without authentication, so I just used it in my script.

@orgitnized
Copy link

To this day it still works. I love you for making it haha - works perfectly!!! Thanks again for making this, @ak9999

@ak9999
Copy link
Author

ak9999 commented Jun 14, 2022

To this day it still works. I love you for making it haha - works perfectly!!! Thanks again for making this, @ak9999

Music to my ears. :)

@jftirone
Copy link

Awesome, saved me a lot of heartache.

@patthen
Copy link

patthen commented Sep 22, 2022

<3 <3 <3

@Eternal-student
Copy link

Awesome from me too, thank you v much

@JasonPavlas
Copy link

Nice, clean, and simple solution you made!

I could have sworn I saved the uninstall file SOMEWHERE, but NOPE...

Ran your script in powershell ISE, I got a pop-up asking me if I wanted to run the Automate Uninstaller (had the connectwise branding, too) and BOOM.

Thanks, Sir!

@Imburr
Copy link

Imburr commented Jun 7, 2023

Will this work on a probe?

@MartinO-95
Copy link

Works great! Thanks for this!

@ssi-eenwall
Copy link

Brilliant, thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment