Remove all permissions to multiple files

908 views
Skip to first unread message

John Shearer

unread,
Aug 16, 2022, 11:47:35 AM8/16/22
to google-ap...@googlegroups.com
I have a shared drive with hundreds of files - one for each student.  Each file has been specifically shared to multiple users & groups (on top of the Shared Drive permissions)

Is there a way to 'remove all sharing' to every file?  It looks like I have to dump the ACLs for each file and then step through them, but I was hoping it could be a little easier.

Thanks!

--

John D. Shearer | Associate Director
Department of Information Technology
Northfield Mount Hermon

One Lamplighter Way, Mount Hermon, MA 01354  nmhschool.org

NMH CONFIDENTIALITY NOTICE: This transmission may contain privileged and confidential information, including information protected by federal and state privacy laws such as HIPAA and FERPA. It is intended only for the use of the person(s) named above. If you are not the intended recipient, please contact the sender by reply email or by telephone, and destroy all copies of the original message.

Joseph Grimes (From GAT Labs)

unread,
Aug 16, 2022, 12:01:52 PM8/16/22
to google-ap...@googlegroups.com
You can't really execute actions on multiple files with GAM.

You could try using GAT Flow to tidy up your domain, you can remove all sharing permissions for all shared files too.

It's not a free service, but it's very reasonably priced, and further discounts are offered to schools.

--
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/CABa1FxitbYKuxVPY6uAhWQSb5TgAOwVLVOKWUEs_FCpaoKmQOQ%40mail.gmail.com.


--
Joe Grimes
GAT Labs Ltd
a:
12 Hume St, Dublin 2, D02 XN44, Ireland
w:gatlabs.com e: sa...@generalaudittool.com
...

GAT has introduced many new features, for a quick overview of the many things you can now do check out our video tutorials from our Youtube channel


Brian Kim

unread,
Aug 16, 2022, 12:04:13 PM8/16/22
to GAM for Google Workspace
You could apply restriction to the Shared Drive so that non-members cannot access the files. Restriction would override the permission on the files in the Shared Drive, which would give you the time to remove the ACLs.

John Shearer

unread,
Aug 16, 2022, 2:14:04 PM8/16/22
to google-ap...@googlegroups.com
Thanks - I like the idea of tweaking the shared drive, but would prefer the cleanliness of actually removing the permissions.  I also found that github article, but was hoping for a 'bulk' process.

Here is what I did:

I run this for every file and filter out the Inherited permissions (the shared drive permissions):
gam config csv_output_row_filter "permission.teamDrivePermissionDetails.0.inherited:boolean:False" user <me> print drivefileacls <fileID> oneitemperrow >> Permissions_comp.csv

Then run this:
gam csv Permissions_comp.csv gam user <me> delete drivefileacl ~id "id:~~permission.id~~"

The duplicate header lines in the csv just throw a harmless error.

Not pretty, but it worked.

Thanks!


--
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.
Reply all
Reply to author
Forward
0 new messages