Fun and games with "claim ownership" and "transfer ownership"

200 views
Skip to first unread message

Mark Rowan

unread,
Jul 26, 2021, 1:17:05 PM7/26/21
to GAM for Google Workspace
I'm using GAMADV to transfer ownership of 100k+ files before moving them into alternative folder structures and, for the most part, everything has gone pretty well.

I think I managed to hit some API limits along the way, which delayed things considerably but progress was made the following day, until I think I hit API limits again, with just 1.5k files still needing to be "owner transferred"

The problem I have now is that no progress has been made in the last 48 hours, "claim ownership/transfer ownership" just refuses to change the owner.  After 48 hours I would've expected quotas to have been reset if the initial delays were caused by API limits.

In the commands that follow, I'm using a Google Sheet to hold the "transfer data" and using the following parameters in the GAM commands:

ad...@domain.com is the SA account that is issuing the GAM commands
123456.......XYZ is the fileID of the Sheet containing the required data
'In-scope Files' is the tab in the Sheet containing the required data
newOwner is the column header of the column containing the email address of new owner
originalOwner is the column header of the column containing the email address of the current owner
fileID is the column header of the column comtaining the filID of the file to be transferred

Steps carried out as follows:
---------------------------------------------
1.  gam csv gsheet ad...@domain.com 123456.......XYZ 'In-scope Files' gam user '~originalOwner' add drivefileacl '~fileID' user '~newOwner' role editor (viewer also works with "claim ownership")
2.  gam csv gsheet ad...@domain.com 123456.......XYZ 'In-scope Files' gam user '~newOwner' claim ownership '~fileID' retainrole none
---------------------------------------------

I've also tried using the following instead of the step 2 command above:

---------------------------------------------
gam csv gsheet ad...@domain.com 123456.......XYZ 'In-scope Files' gam user '~originalOwner' transfer ownership '~fileID' '~newOwner'
---------------------------------------------

altho I avoided this initially as I would then need to run an additional command to remove the originalOwner from the ACL of each file afterwards (a requirement of the process I'm trying to carry out, which claim ownership '~fileID' retainrole none manages beautifully)

The message I'm getting doesn't really help that much, and is as follows:

Response to "claim ownership" command
User: new....@domain.com, Claim Ownership 1 Drive File/Folder User: new....@domain.com, Claim Ownership Drive File: <Some document title> (AaAaAa.....12346) User: new....@domain.com, Claim Ownership 0 Users

Response to "transfer ownership" command
User: origina...@domain.com, Transfer Ownership 1 Drive Folder User: origina...@domain.com, Transfer Ownership Drive File: <Some document title> (AaAaAa.....12346) User: origina...@domain.com, Transfer Ownership 0 Drive Files/Folders to User: new....@domain.com

I've deliberately swerved using "add drivefileacl <file ID> user <Email Address of Recipient> role owner" in order to avoid the "notification storm" that would be caused by the "you're now the owner of...." messages that would be generated.

Any ideas as to why a command that has worked successfully for approx 100k files refuses to work for the final 1.5k files?  I've checked and newOwner has definitely been added to the ACL.  It's not even specific to a user, for example one user has 304 files that required ownership transfer, the command worked on 272 of them, but refuses to work on the final 32, producing the "error" message above (not really an error message, but you know what I mean) 😉

This is driving me nuts, so any hints/tips on what to look for (maybe it's a file property that has gone awry) would be massively appreciated.

Mark
Reply all
Reply to author
Forward
0 new messages