Synopsis
Stops theLTService and LTSvcMon Windows services on the local machine. Before issuing stop commands, the function sends Kill VNC and Kill Trays commands to the running agent. It then stops both services via sc.exe and waits up to 1 minute for them to reach the Stopped state. Any remaining LTTray, LTSVC, or LTSvcMon processes are forcibly terminated.
Syntax
Parameters
Shows what would happen if the command runs without actually executing it. No services are stopped and no processes are killed.
Prompts for confirmation before stopping the services.
Behavior
- Both
LTServiceandLTSvcMonmust already be installed. The function returns an error if either service is not found. - Before stopping,
Invoke-LTServiceCommandis called withKill VNCandKill Traysto cleanly shut down remote control and tray processes. - Stop commands are issued to both services via
sc.exe stop. - The function polls every 2 seconds for up to 1 minute waiting for both services to reach the
Stoppedstate. - If any
LTTray,LTSVC, orLTSvcMonprocesses remain after the wait, they are forcibly terminated withStop-Process -Force.
A warning is written if the services have not fully stopped within the 1-minute timeout, but the function does not exit with an error in that case.