During my time deploying agents, I have used both the Probe method (yes, I know it’s an awful word!) and also via GPO. So far, the GPO has been my ‘weapon of choice’ because not only can you use this method to ‘strategically phase the agent roll-out’ (linking the GPO to one OU [Organizational Unit] at a time), but also due to the fact that it just works! I can’t begin to tell you the amount of times I have known the ‘probe method’ to fail, both form first hand experiences and also amongst other LT admins, who have tried. And failed!
The code to get this going is MS GPO stuff in its simplest form. Just be sure to add the GPO (as a batch file of course) to the Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shudwon) > Startup GPO location, as you will want this script to run when the PC starts up.
|Text |||copy code |||?|
If EXIST c:windowsltsvcltsvc.exe GOTO EXIT
copy \domain-name.localNetlogonLabTechAgent.exe %windir%temp
call %windir%tempLabTechAgent.exe /s
What does the script actually do?
- First, it checks to see if the agent is already installed. It does this by looking for ltsvc.exe (The agent process itself). If it detects the file is there, then it EXITS. If it does not detect it, then it jumps to the INSTALL section.
- Assuming the file check failed (i.e.: LT is NOT installed), it then copies the LabTechAgent.exe from \domain-name.localnetlogon to the %windir%temp folder on the PC.
- Finally, once the agent exe is copied, it installs the agent. /silently.
%windir%temp – Domain Users can MODIFY that folder.
I’m sure everyone knows this, but just in case, I will mention this anyway…
1. Change “\domain-name.localNetlogon” & “LabTechAgent.exe” to suit your environment.
2. Be sure to link your script to an OU that contains COMPUTERS!
The number of times I have seen this fail due to these simplest things is quite astonishing!
If you feel inclined, you can expand on this. Instead of creating just ONE Agent for each client and then, once the agent appears in the LT Control Center, drag them to the relevant location, you can in-fact create multiple ‘location based Agent Installers’ and create a GP Object and Script for each one, but for most use cases…this can be a little overkill and has the potential to become unmanageable. But it is, of course, very doable!
It’s just a case of ‘Different Strokes, for Different folks!’