This function will reinstall the LabTech agent from the machine.
Redo-LTService [[-Server] <String[]>] [[-ServerPassword] <String>] [[-LocationID] <String>] [-Backup] [-Hide] [[-Rename] <String>] [-Force] [-WhatIf] [-Confirm] [<CommonParameters>]
This script will attempt to pull all current settings from machine and issue an 'Uninstall-LTService', 'Install-LTService' with gathered information. If the function is unable to find the settings it will ask for needed parameters.
This is the URL to your LabTech server.
Example: https://lt.domain.com
This is used to download the installation and removal utilities.
If no server is provided the uninstaller will use Get-LTServiceInfo to get the server address.
If it is unable to find LT currently installed it will try Get-LTServiceInfoBackup
Required false
Position 1
Default value
Accept pipeline input true (ByValue, ByPropertyName)
Accept wildcard characters false
This is the server password that agents use to authenticate with the LabTech server.
SELECT SystemPassword FROM config;
Required false
Position 2
Default value
Accept pipeline input true (ByPropertyName)
Accept wildcard characters false
The LocationID of the location that you want the agent in
example: 555
Required false
Position 3
Default value
Accept pipeline input true (ByPropertyName)
Accept wildcard characters false
This will run a New-LTServiceBackup command before uninstalling.
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false
Will remove from add-remove programs
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false
This will call Rename-LTAddRemove to rename the install in Add/Remove Programs
Required false
Position 4
Default value
Accept pipeline input false
Accept wildcard characters false
This will force operation on an agent detected as a probe.
Required false
Position named
Default value False
Accept pipeline input false
Accept wildcard characters false
Required false
Position named
Default value
Accept pipeline input false
Accept wildcard characters false
Required false
Position named
Default value
Accept pipeline input false
Accept wildcard characters false
PS C:\>Redo-LTService
This will ReInstall the LabTech agent using the server address in the registry.
PS C:\>Redo-LTService -Server https://lt.domain.com -Password sQWZzEDYKFFnTT0yP56vgA== -LocationID 42
This will ReInstall the LabTech agent using the provided server URL to download the installation files.
Version: 1.5
Author: Chris Taylor
Website: labtechconsulting.com
Creation Date: 3/14/2016
Purpose/Change: Initial script development
Update Date: 6/1/2017
Purpose/Change: Updates for better overall compatibility, including better support for PowerShell V2
Update Date: 6/8/2017
Purpose/Change: Update to support user provided settings for -Server, -Password, -LocationID.
Update Date: 6/10/2017
Purpose/Change: Updates for pipeline input, support for multiple servers
Update Date: 8/24/2017
Purpose/Change: Update to use Clear-Variable.
Update Date: 3/12/2018
Purpose/Change: Added detection of "Probe" enabled agent.
Added support for -Force parameter to override probe detection.
Updated support of -WhatIf parameter.