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.