Assign different permissions to multiple shared drives in bulk

121 views
Skip to first unread message

Juarez Weiss

unread,
Jan 10, 2023, 11:06:32 AM1/10/23
to GAM for Google Workspace
Hello everyone,

I'm trying to assign multiple ACLs to multiple Shared Drives using a single command and a single spreadsheet.

I know I could run the following command
gam csv gsheet us...@domain.com google-sheet-id permissions gam user man...@domain.com add drivefileacl ~drive-id user ~new-user role ~acl
if the spreadsheet was in the following structure:
drive-id new-user acl
TeamDrive1 us...@domain.com manager
TeamDrive1 us...@domain.com commenter
TeamDrive1 us...@domain.com viewer
TeamDrive1 us...@domain.com viewer
TeamDrive2 us...@domain.com manager
TeamDrive2 us...@domain.com commenter
TeamDrive2 us...@domain.com viewer
TeamDrive2 us...@domain.com viewer
etc...

But I need to add 7-8 different permissions for hundreds of shared drives! Impossible to do the above manually.

Is there a way to have a command that reads the TeamDriveID, user, and access in a single row?
Something like gam csv gsheet us...@domain.com google-sheet-id permissions gam user man...@domain.com add drivefileacl ~drive-id user ~new-user role ~acl user ~new-user-1 role ~acl-1 user ~new-user-2 role ~acl-2 etc?

Thank you!

Ross Scroggs

unread,
Jan 10, 2023, 1:43:35 PM1/10/23
to google-ap...@googlegroups.com
Juarez,

No, add drivefileacl only accepts one ACL. Your original proposal is the way you'll have to do it.
I would add the following after the initial gam to log the command results
redirect stdout ./AddSharedDriveACLs.txt multiprocess redirect stderr stdout

Send me a Meet/Zoom invitation if you'd like to discuss this

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/3043fbe4-9272-4c9f-8f9e-b87453948a90n%40googlegroups.com.


--

Juarez Weiss

unread,
Jan 10, 2023, 1:47:33 PM1/10/23
to google-ap...@googlegroups.com
Hi Ross,

Thank you for the quick response. I figured it wasn't possible so I went ahead and created a spreadsheet tab for each ACL, since I already had the list of the DriveIDs. So I just had to paste the drive IDs in a column, add one row with user+access, and double click to fill them out all the way down. The ran one line of command for each tab. Not an elegant solution, but solved it.

Thanks!

---
Juarez Weiss (he/him/his)
IT Operations Consultant | Lilt
BRT timezone (PST+4 / CET-5)

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/R8xOfi5eVkI/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAJkvRS-9XcgkuQtUrunhLYV8WddepzNVANiM1yzRb4CHnJ%3D5jg%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages