Updating a resource's calendar ACL

265 views
Skip to first unread message

Josh Miller

unread,
Mar 9, 2020, 10:52:43 AM3/9/20
to GAM for G Suite
At my organization, we have calendar resources that are shared between members in a department, and the way I go about it is that I take the resource's calendar and share the calendar with a group containing the members of that department. The permissions are 'make changes and manage sharing'

Now with GAM I'm able to make the calendar and resource, but how can I find the calendar's email easily? This example in the docs looks to be it, but since these emails are automatically generated, I can't find it easily. I can use `gam info resource <id>` which returns the email, but with Powershell I don't know if I can easily take `resourceEmail` and assign it to a variable.

Any help is appreciated

Susan McClure

unread,
Mar 10, 2020, 2:36:45 PM3/10/20
to GAM for G Suite
I am not an expert, but this is what I have been doing when creating a bunch of new resource calendars. 

Only AFTER the resource is created, does it have an email address. 
I pull the resource's key fields into a .csv file, then update the calendar's ACLs using the "resourceEmail" field.  
  • gam print resources fields "resourceName,buildingId,resourceEmail" > .\PrintResources_03102020.csv
I massage that .csv with powershell to pull out just the resources for the buildingId I am currently creating/updating. 
  • Import-Csv -Path .\PrintResources_03102020.csv | ?{"$_.resourceName" -like "*ABL*" -or "$_.buildingId" -like "*ABL*"} | Export-Csv .\ABLresourcesViaPrintCmd.csv -NoTypeInformation
I then update the ABLresourcesViaPrintCmd.csv file; manually, to strip out any records for calendars that I don't want to update ACLs for.  Now I have 1 record for each resource calendar, each with the field of "resourceEmail".  New file = ABLresourcesViaPrintCmd_CLEANED.csv   

Now I run 1 "calendar add" command per owner|reader|writer that I need to add to all the resource calendars

  • gam csv .\ABLresourcesViaPrintCmd_CLEANED.csv gam calendar ~resourceEmail add owner wri********.edu sendnotifications true
And you can check them all, after updating ACLS with: 

  • gam csv .\ABLresourcesViaPrintCmd_CLEANED.csv gam calendar showacl
Someone with more gam skills on file redirection, and queries, can probably make this a much cleaner process.
I am anxious for any further insight someone else has.  
Reply all
Reply to author
Forward
0 new messages