Wiping Resource Calendars

290 views
Skip to first unread message

Russell Legear

unread,
Dec 5, 2018, 11:26:48 AM12/5/18
to GAM for G Suite
I've been tasked with nuking all events on our resource calendars to free up conference rooms, and I'm wondering the best way to do that with GAM given the instructions state you can't use the gam calendar wipe command on a resource calendar. Would this be done with the query command instead? And if so, does anyone know what that query is supposed to be? Google's query documentation isn't very good.

Thanks,
-Russ

+KimNilsson

unread,
Dec 6, 2018, 3:16:08 AM12/6/18
to GAM for G Suite
Get a list of all events, then tell GAM to remove them all, one by one.

+KimNilsson

unread,
Dec 6, 2018, 3:16:40 AM12/6/18
to GAM for G Suite
I mean, you export the events to a csv, and then use that csv as input for the delete command.

Russell Legear

unread,
Dec 6, 2018, 2:18:53 PM12/6/18
to GAM for G Suite
Thanks. I actually found out that you can just delete using the "query *" command. That will select all events for the calendar in question and delete them. 

Kim Nilsson

unread,
Dec 7, 2018, 1:49:05 AM12/7/18
to Google Apps Manager
Great, please post your command for others to learn.

/Kim
--
There is No Substitute!

Russell Legear

unread,
Dec 7, 2018, 11:06:38 AM12/7/18
to GAM for G Suite
.\gam.exe calendar resource...@group.calendar.google.com deleteevent query * (add "doit" to actually delete)

Jose Santos

unread,
Feb 6, 2019, 2:20:31 PM2/6/19
to GAM for G Suite
Has anyone confirmed this was able to work?

This email and any attachments are for the exclusive use of the intended recipient(s) and may contain confidential and/or privileged information.  Inadvertent disclosure of this message does not constitute a waiver of any privilege, right or remedy.  If you are not the intended recipient, please do not directly or indirectly use, disclose or distribute this message, and please contact the sender and delete this email, any attachments and all copies.  Climate and its affiliates may use, read or archive email communications (including attachments) through its computer network, as permitted by applicable law.  Climate and its affiliates (or an external service provider) may also scan emails and attachments on its computer network to ensure systems operate efficiently and to minimize security risks. Thank you.

Russell Legear

unread,
Feb 6, 2019, 2:51:29 PM2/6/19
to google-ap...@googlegroups.com
This works, however, because Calendar and it’s APIs are bubblegum & duct tape code (I assume based on past experience), you may hit events that can’t be deleted for mysterious reasons. You might get a 403 error. That’s happened with one calendar for me already. You may also have to re-run the command multiple times as sometimes it misses events or ends prematurely (I’m hoping Jay will look at this particular code and fix these issues). 

I’m going to be running this on 20 or so resource calendars next week and will see how it does in bulk. 

--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/ybGS3xBzRKo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/940396c4-9988-4826-a073-0d917e93bbdd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jose Santos

unread,
Feb 6, 2019, 3:28:11 PM2/6/19
to GAM for G Suite
Thanks, Russell. I was able to confirm the deletion of a 100+ events before running into 403. 


On Wednesday, February 6, 2019 at 11:51:29 AM UTC-8, Russell Legear wrote:
This works, however, because Calendar and it’s APIs are bubblegum & duct tape code (I assume based on past experience), you may hit events that can’t be deleted for mysterious reasons. You might get a 403 error. That’s happened with one calendar for me already. You may also have to re-run the command multiple times as sometimes it misses events or ends prematurely (I’m hoping Jay will look at this particular code and fix these issues). 

I’m going to be running this on 20 or so resource calendars next week and will see how it does in bulk. 

On Feb 6, 2019, at 11:22 AM, Jose Santos <jose....@climate.com> wrote:

Has anyone confirmed this was able to work?

On Friday, December 7, 2018 at 8:06:38 AM UTC-8, Russell Legear wrote:
.\gam.exe calendar resource...@group.calendar.google.com deleteevent query * (add "doit" to actually delete)

On Friday, December 7, 2018 at 12:49:05 AM UTC-6, +KimNilsson wrote:
Great, please post your command for others to learn.

/Kim
--
There is No Substitute!

This email and any attachments are for the exclusive use of the intended recipient(s) and may contain confidential and/or privileged information.  Inadvertent disclosure of this message does not constitute a waiver of any privilege, right or remedy.  If you are not the intended recipient, please do not directly or indirectly use, disclose or distribute this message, and please contact the sender and delete this email, any attachments and all copies.  Climate and its affiliates may use, read or archive email communications (including attachments) through its computer network, as permitted by applicable law.  Climate and its affiliates (or an external service provider) may also scan emails and attachments on its computer network to ensure systems operate efficiently and to minimize security risks. Thank you.


--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/ybGS3xBzRKo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

Russell Legear

unread,
Feb 6, 2019, 3:30:04 PM2/6/19
to google-ap...@googlegroups.com
While the error sucks, glad to know I’m not the only one hitting it. Jay, can you chime in on that error?



To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Russell Legear

unread,
Feb 21, 2019, 10:44:06 PM2/21/19
to GAM for G Suite
So, I'm going to put out a general warning for anyone with a lot of events on a calendar.

Simply put, the "doit" command does NOT run on all available events when you use "query *". If you run it without "doit," you will get a completely different result than when do use "doit." Not just the 403 errors, but the query itself returns something completely different.

For example, I ran this on 35 calendars with a total of 172,000+ events that the test-run mode said would be deleted. When I added "doit," it only ran against 3000 events.

This is a bug. Avoid this command until it gets fixed. 
Reply all
Reply to author
Forward
0 new messages