Take a look at Script: Create or change smart group(s)
Especially this part (checking if a record at a location exists) could be useful:
You’ll have to study the script on your own
Take a look at Script: Create or change smart group(s)
Especially this part (checking if a record at a location exists) could be useful:
You’ll have to study the script on your own