Updated Script to properly check %windir%/ltsvc/ for nc.exe. Coding at 3 am may be hazardous to your health. Carry on.
So.. RockFoo and I spent the evening getting this working. As it was one of those "needtohaves" to get the rest of our techs off of Kaseya. A reliable, working access to command prompt for general purpose behind the scenes work. So without further adieu...
No real easy way to export/import that i know of. So here are the fields, for your copy+paste pleasure.
Name: Command Prompt
Arguments: %ComputerName% %LocalIP1% %LocalPort1%
Agent Run Before: start /b %windir%\ltsvc\nc.exe -l -p 1234 -d -e cmd.exe
Agent Run After: taskkill /f /im nc.exe
and then Redirected Ports: LocalPort = 0, LocalIP = 127.0.0.1, RemotePort = 1234, RemoteIP = %RemoteIP%, SocketType = 0 (TCP Local Listen)
The remaining setup consists of files in the zip file attached. Done up in a couple different directories.
:Copy to LabTech Share:
This is the nc.exe executable - downloaded from here via script to agent.
:Export to LabTech CC Install Folder:
Same nc.exe that runs on local pc to connect through tunnel, and a RemoteCMD.bat file that makes the command prompt look special. Special-ish at least. Titles it as "LabTech Remote CMD: %COMPUTERNAME%". This is for those people that always have 20+ command prompts open, and multiple connections to different sites. It makes it quickly ID'able.
:Import Script - Deploy NC.EXE to computer:
Self-explanatory, simple couple-liner that checks if file exists, other wise, downloads nc.exe to LTSVC folder.
--- We've got it working pretty reliably. We have noticed that you can only have ONE tunnel open to an agent on a given port at a time. I dunno if this is by design, but it's not a deal breaker for us, we would only really have one tech connecting to a given command prompt at a time anyways.
Any questions. Let me know!
LabTech Remote Command Prompt.zip