Recursively change ownership and permissions on a folder and its contents

2,422 views
Skip to first unread message

Jonathan King

unread,
Jan 9, 2017, 11:13:43 PM1/9/17
to GAM for G Suite
Hi,

We have a hierarchy of files/folders that have had the permissions 'messed up' and some of the documents contained within are owned by a variety of folks. I'd like to be able to set ownership to a specific user and bulk-change all the permissions to a set list. Can GAM do this? I learned about GAMADV-X today; can it do that? It seems that operating on a hierarchy just isn't built-in to G Suite, and I don't really want to write a whole set of batch commands to get a file list and then operate on it. Hoping I've just missed an available option somewhere.

Thanks for any direction all you helpful GAM users can give, this is rather urgent :)

-jonathan

+KimNilsson

unread,
Jan 10, 2017, 6:22:43 AM1/10/17
to GAM for G Suite
Yes, GAMADV-X can do it (don't know if regular GAM can).

gam user EmailAddressOfNewOwner claim ownership FolderIDofTheTopFolder

I don't remember 100%, but perhaps the new owner needs to have access to TheTopFolder.
I usually add a pipe like this to my commanda, so I have a log of what happened.

| tee -a ~/GAM-activities/NewOwner-FolderID.txt

Jonathan King

unread,
Jan 11, 2017, 8:48:38 AM1/11/17
to GAM for G Suite
Thanks so much for that tip. It seems that this will change Ownership, but not Permissions. I can change permissions on a hierarchy recursively using BetterCloud Enterprise, but that's rather spendy.

Kim Nilsson

unread,
Jan 11, 2017, 10:04:58 AM1/11/17
to google-ap...@googlegroups.com
You can most likely also remove all other users' access after the ownership transfer. I just don't know the syntax by heart. 

Patrick McNeal

unread,
May 8, 2018, 11:14:28 AM5/8/18
to GAM for G Suite
It does appear the new owner needs access to TheTopFolder for this to work. Thanks for the tip - this has saved us lots of time.
Reply all
Reply to author
Forward
0 new messages