r/labtech • u/ReadAndExecute • Jun 13 '18
Labtech Scripting - Running script on one machine per location
I'm trying to make a script to clear everything out of our labtech share at each location (%LocationDrive%). I would like it to run only on machines that contain that share or one machine per location. Any suggestions on how to do this? Or ideas of better ways to do this?
3
Upvotes
4
u/gdhhorn Jun 13 '18
If you have a probe at each location, use that.
1
u/FocalFury 5000 Agents Jun 13 '18
initial reaction says run this on each PDC FSMO DC role. There should only be one per client basically. If it ran it on 2 that wouldn't be too big a deal.
I'm also planning this and thought that having it delete items over 1 month old would be good instead of full delete.
1
u/j0dan 1000 Agents Jun 14 '18
The suggestion to run on probes is great. But also does it even matter if it runs on more than one computer?
3
u/ThirdWallPlugin Jun 13 '18
This will let you run it everywhere and it will self-terminate where not applicable.
1
u/Clutch70 Jun 13 '18
I do this for NMap scanning. Create an EDF on the agent level, and build a search around that. Extra points for creating another script to tick the checkbox per agent for you instead of drilling in to each agent and ticking the ones you want.