Skip to main content

Synopsis

Sends one or more named control commands to the running LTService agent. Commands are dispatched as service control codes via sc.exe control LTService <code>. The function accepts pipeline input and processes multiple commands in a single call.

Syntax

Invoke-LTServiceCommand [-Command] <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]

Parameters

Command
String[]
required
One or more commands to send to the agent. Accepts pipeline input. Must be one of the validated command names listed in the Known commands section below.
  • Position: 1
  • Pipeline input: yes (ByValue)
WhatIf
SwitchParameter
Shows what would happen if the command runs without actually sending any control codes.
Confirm
SwitchParameter
Prompts for confirmation before sending each command.

Known commands

The -Command parameter is validated against the following set. Passing a value not in this list will produce a validation error.
CommandControl codeDescription
Update Schedule128Refresh the agent’s scheduled tasks from the server.
Send Inventory129Collect and upload a full hardware/software inventory.
Send Drives130Upload disk drive information.
Send Processes131Upload the current process list.
Send Spyware List132Upload spyware scan results.
Send Apps133Upload the installed applications list.
Send Events134Upload Windows event log entries.
Send Printers135Upload printer information.
Send Status136Send an immediate status check-in to the server. Used internally by Start-LTService after startup.
Send Screen137Capture and upload a screenshot.
Send Services138Upload the Windows services list.
Analyze Network139Run a network analysis and upload results.
Write Last Contact Date140Update the last contact timestamp in the registry.
Kill VNC141Terminate any active VNC/remote control session. Used internally by Stop-LTService before stopping.
Kill Trays142Terminate the LTTray process. Used internally by Stop-LTService before stopping.
Send Patch Reboot143Notify the server of a pending patch-related reboot.
Run App Care Update144Trigger an App Care update.
Start App Care Daytime Patching145Start the App Care daytime patching process.
LTService must be installed and in the Running state. If the service is stopped or not found, a warning is written and no command is sent.

Examples

Send an immediate status check-in:
Invoke-LTServiceCommand 'Send Status'
Kill VNC and tray processes in a single call:
Invoke-LTServiceCommand ('Kill VNC', 'Kill Trays')
Send multiple commands via the pipeline:
'Send Inventory', 'Send Apps' | Invoke-LTServiceCommand

Build docs developers (and LLMs) love