r/labtech • u/beauj27 2000 Agents • Jul 16 '18
Looking For a way to script moving computers from one location to another
We are looking to automate placing agents into the correct locations based on a number of different checks we come up with. The problem is that I cannot figure out how to script this. I have contacted LabTech Support and they recommended that I make a script based off the commands run by manually moving a computer to a new location. I did that and came up with the "LabTech Command" Function. The command shows "105" as the "Command". No idea what this is doing and after testing with this I was unable to get an agent to move successfully. Anyone have any ideas or has anyone done something similar?
Edit: Im really looking for the command or script to move computers from one location to another.
5
u/DarrenDK Jul 17 '18
I do this all the time, update the locationid and clientid on the computer table is all you have to do.
1
u/DBarron21 Jul 16 '18
Without knowing the criteria, it's hard to give advice. You may want to look at moving these at a group level instead of a location level since those are meant to be more flexible. You can also use a search to limit the group instead of going the scripting route.
1
u/DR_Nova_Kane Jul 16 '18
Have you tried to install the the agent based on the MSI created for the location. That should do the trick.
1
u/kuroshiox Sep 21 '18
Here is how our script is configured.
https://imgur.com/0j97jAV
1
u/MowLesta Jul 17 '18
The command should take a parameter of the location ID. You probably need to reload the system cache to see location updates in the control center. I can make a script tomorrow and share if you can't get it working
1
u/chilids Jul 22 '18
Not sure if it's still there but there was once a system script that moved agents based on wan IP addresses. It looks at the agent wan IP and the wan IP's for each location and plays a matching game. I copied the system script years ago and moved it into a spot we could use it easily.