Recurring Meeting Room Event Cleanup

871 views
Skip to first unread message

Simon Smart

unread,
Apr 13, 2023, 5:52:41 AM4/13/23
to GAM for Google Workspace
Hello folks

I'm curious before I build this if anyone has any good (or unique/interesting) workflows for tackling the buildup of recurring, unattended and/or orphaned events clogging up Room calendars for orgs? I've had several customers reach out to me with this problem and it feels very GAMabble.

I'm thinking we do a one off cleanup and then a regular 'clear out' on an annual basis maybe?

I think maybe the following stages:
  1. Get all resource calendars > resources.csv
  2. Filter this down to remove rooms we don't want to touch (Boardrooms for example)
  3. Get all recurring events for calendar IDs in resources.csv
  4. Remove recurrences after date xxx (from Room calendars keeping the event itself intact in organisers calendar but freeing up the resource)
Let me know if you know any workflows that might make this easier, any suggestions or additions you'd make or anything you've seen or had experience with in the past you thought was interesting.

Thanks
Si

Simon Smart

unread,
Apr 19, 2023, 1:27:46 PM4/19/23
to GAM for Google Workspace
So here's where I got to but I need a tiny steer just to finish off the command... I've nearly managed to string the whole thing into one command.

//[WORKING] - Get all resources that have the type 'Meeting Room' | For that list of resources multiprocess print the events that have 1 or more recurrences to recurringEvents.csv
gam config csv_output_row_filter "'resourceType:text=Meeting Room'" print resources | gam redirect csv ./recurringEvents.csv multiprocess csv - gam config csv_output_row_filter "'recurrence:count>=1'" calendar ~resourceEmail print events

I needed to multiprocess that last part so that I didn't get multiple outputs but I'm a little confused on how I can multiprocess but then pass that into the next command instead of into an actual .csv file

I understand this is wrong but just for the sake of explanation I want to add something like:
| gam csv recurringEvents.csv gam calendar ~calendarId delete events ~id

But then GAM tries to delete the events before recurringEvents.csv has been created

I think I need to adjust the last multiprocess/redirection or introduce some equivilent of commitbatch if someone can point me in the right direction?

Thanks
Si

Ross Scroggs

unread,
Apr 19, 2023, 1:33:18 PM4/19/23
to google-ap...@googlegroups.com
Simon,

This should work:
gam config csv_output_row_filter "'resourceType:text=Meeting Room'" print resources | gam redirect csv - multiprocess csv - gam config csv_output_row_filter "'recurrence:count>=1'" calendar ~resourceEmail print events | gam csv - gam calendar ~calendarId delete events ~id

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/4ba7413c-46cc-4950-a243-d8d31a590d1an%40googlegroups.com.


--

Simon Smart

unread,
Apr 19, 2023, 1:43:31 PM4/19/23
to GAM for Google Workspace
Perfect... legend as always

If anyone's following along the only other change I've made is I forgot to put "eventid" before ~id (and additionally I've left off the "doit" so I can test before deleting) so the final command is:

gam config csv_output_row_filter "'resourceType:text=Meeting Room'" print resources | gam redirect csv - multiprocess csv - gam config csv_output_row_filter "'recurrence:count>=1'" calendar ~resourceEmail print events | gam csv - gam calendar ~calendarId delete events eventid ~id [doit]

Reply all
Reply to author
Forward
0 new messages