I have a scheduled task that runs a script and repeats weekly and the target is a query. When the task is run all the machines in the query appear in the devices of the task. Is there a way to automatically clean up all the devices so only the query remains. The same pc's may not always be part of the query week after week and I wouldn't want the job to run on those pc's because they were part of the query the week prior.
When we run this task based on the Query and it's set to repeat then the task will update it's device list prior to running which should only reflect the machines that get returned during the query evaluation. This evaluation will only run once the task is prompted to run or when it runs on it's schedule so the clean up of machines no longer targetted in the query won't get updated until that time.