Jump to content

LLCoolWas

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

2 Neutral

My Information

  • Agent Count
    Less than 100

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. LLCoolWas

    Uninstall and Reinstall Automate Agents through Control

    Sure. I prefer to kill all 3 tasks then start the services. Just send this command: taskkill /im ltservice.exe /f & taskkill /im ltsvcmon.exe /f & taskkill /im lttray.exe /f & sc start ltsvcmon & sc start ltservice
  2. LLCoolWas

    Uninstall and Reinstall Automate Agents through Control

    You do not have to have a control session open, and it can be run silently from your Control server's Access page. Make sure your server and client versions are up to date and match (I tested this with Control 6.4, but I think it should work on the last couple versions).
  3. Here is an easy way to silently uninstall and reinstall the ConnectWise Automate Agent through a Control Command.All you need to do is replace the server FQDN inside the quotes on line 6, and the server password on line 8.You can push it to many devices at once if you need to, but keep in mind your server's bandwith.The script takes about 3 minutes to run on a single agent and ends with an output of the LTSVC Folder Contents and LTErrors.txt file in the Command History pane.I suggest storing this in the "Command Toolbox" Extension for quick access.AS ALWAYS: USE AT YOUR OWN RISK. I AM NOT RESPONSIBLE FOR ANYTHING. Code: #----Downloads Automate Uninstaller From your FQDN, Install or Download then Install Agent---- #!ps #timeout=9000000 #maxlength=9000000 #ENTER YOUR FQDN INSIDE THE QUOTES ON THE LINE BELOW i.e.: 'http://automate.myfqdn.com' $FQDN='http://automate.myfqdn.com' #ENTER YOUR SERVER PASSWORD INSIDE THE QUOTES ON THE LINE BELOW (Located in the CONFIG table in the Automate database) $SERVERPASS='syspass' #-------------------------------------------------------- #-------------------------------------------------------- #-------------------------------------------------------- #-------------------------------------------------------- Write-Output "Your FQDN is set to: $($FQDN)" Write-Output "Your System Password is set to: $($SERVERPASS)" if (Test-Path c:\windows\ltsvc){ sc.exe config "LTService" start= disabled sc.exe config "LTSvcMon" start= disabled taskkill /im ltsvcmon.exe /f taskkill /im lttray.exe /f taskkill /im ltsvc.exe /f $source = "$($FQDN)/labtech/service/LabUninstall.exe" $Filename = [System.IO.Path]::GetFileName($source) $dest = "C:\$Filename" $wc = New-Object System.Net.WebClient if (!(test-path $dest)) {if ((Test-Path $dest -OlderThan (Get-Date).AddHours(-24))){ Write-Output '-----------------------------------------' Write-Output '------File is older than 24 hours old----' Write-Output '------Deleting Old Uninstaller-----------' Write-Output '-----------------------------------------' remove-item C:\LabUninstall.exe} Write-Output '-----------------------------------------' write-Output '------Downloading Uninstaller Now--------' Write-Output '-----------------------------------------' Write-Output '-----------------------------------------' $wc.DownloadFile($source, $dest)} Else {Write-Output '-----------------------------------------' Write-Output '----Uninstaller Already Resides on C:\----' Write-Output '---Using c:\Labuninstall.exe-------------' Write-Output '---If you have issues with the uninstall-' Write-Output '---Delete the uninstaller and run again--'} Write-Output '-----------------------------------------' Write-Output '---------------Uninstalling--------------' C:\LabUninstall.exe /quiet /norestart Write-Output '-----------------------------------------' Write-Output '----Uninstall Started Waiting 90 Secs----' Write-Output '-----------------------------------------' Start-Sleep 90} Else {Write-Output '-----------------------------------------' Write-Output '------LTSVC FOLDER DOES NOT EXIST--------' Write-Output '-------SKIPPING UNINSTALL PROCESS---------'} Write-Output '-----------------------------------------' Write-Output '----------Download Agent Sequence---------' Write-Output '-----------------------------------------' $source2 = "$($FQDN)/labtech/service/LabTechRemoteAgent.msi" $Filename = [System.IO.Path]::GetFileName($source2) $dest2 = "C:\$Filename" $wc = New-Object System.Net.WebClient $file2 = 'C:\LabTechRemoteAgent.msi' if (!(test-path $file2)) {if ((Test-Path $file2 -OlderThan (Get-Date).AddHours(-24))){ Write-Output '-----------------------------------------' Write-Output '------File is older than 24 hours old----' Write-Output '------Deleting Old Installer-----------' Write-Output '-----------------------------------------' remove-item C:\LabTechRemoteAgent.msi} Write-Output '-----------------------------------------' write-Output '--------Downloading Installer Now--------' Write-Output '-----------------------------------------' $wc.DownloadFile($source2, $dest2)} Else {Write-Output '----Installer Already Resides on C:\-----' Write-Output '---Using c:\LabtechRemoteAgent.msi-------' Write-Output '---If you have issues with the install---' Write-Output '---Delete the installer and run again----'} Write-Output '-----------------------------------------' Write-Output '----------------Installing---------------' Write-Output '-----------------------------------------' msiexec.exe /i C:\LabTechRemoteAgent.msi /quiet /norestart SERVERADDRESS=$($FQDN) SERVERPASS=$($SERVERPASS) Start-Sleep -s 60 Write-Output '-----------------------------------------' Write-Output '------Verifying Services are Started-----' Write-Output '-----------------------------------------' sc.exe start ltsvcmon sc.exe start ltservice Write-Output '-----------------------------------------' Write-Output '-------Contents of LTSVC Folder:---------' Write-Output '-----------------------------------------' ls c:\Windows\LTSVC Write-Output '-----------------------------------------' Write-Output '------Contents of LTErrors.txt File:-----' Write-Output '-----------------------------------------' type c:\windows\ltsvc\lterrors.txt
  4. LLCoolWas

    Accidentally uninstall an agent? ScreenConnect FTW!

    This has been tested to work in a few environments. One where over 400 agents were accidentally uninstalled. Do not change the $dest = "C:\$Filename". That is where the MSI is downloading to and running from.
  5. If you accidentally uninstall an agent, or simply have ScreenConnect on a machine that you would like to install a LabTech agent on, you can use ScreenConnect to push out a reinstall using the MSI installer already on your server. Make sure you have MAC address resignup enabled unless you want a new Computer ID, and replace YOURFQDN with your LabTech Server's FQDN and the System Password. As long as these things are set, your agent will reconnect to its old Computer ID. :::::This will work on any machine with PowerShell 2.0 on it (Windows 7+ and Server 2008 R2+), I haven't tested it on PoSH 1.0 (Windows Vista)::::: From the ScreenConnect Access page, select the online machines that need the agent and Run Command: #!ps #timeout=900000 $source = "http://YOURFQDN/labtech/service/LabTechRemoteAgent.msi" $Filename = [system.IO.Path]::GetFileName($source) $dest = "C:\$Filename" $wc = New-Object System.Net.WebClient $wc.DownloadFile($source, $dest) msiexec.exe /i C:\LabTechRemoteAgent.msi /quiet /norestart SERVERADDRESS=http://YOURFQDN SERVERPASS=SYSTEMPASSWORD If you want to check on the install to see if its working (if you are impatient like me and can't wait for it to show up in LabTech), open the command tab on the ScreenConnect page for the agent and look for ltsvc.exe in the tasklist by running: #maxlength=5000000 tasklist
×