How to change the owner of specific files and folders in Drive to another owner with GAM?

7,961 views
Skip to first unread message

Marta Carrica Martínez

unread,
Sep 28, 2016, 8:18:38 AM9/28/16
to Google Apps Manager
Hello, 

I need to change owners of some files and folder to one unique owner in Drive. I supposed that the steps to follow are:

- get files that are not the user who is going to put as owner in CSV
   I used 
  C:\GAM>gam all users show filelist query "!='prueba...@cartagontest2016.com' in owners " > fichero.csv
   
 It´s running but when I added the second part no return information  C:\GAM>gam all users show filelist query "!='prueba...@cartagontest2016.com' in owners and folder='Elegant Themes' " > fichero.csv


- change the owner to another with second script 

Any advice?

thanks for the support




+KimNilsson

unread,
Sep 30, 2016, 3:23:17 AM9/30/16
to Google Apps Manager

I assume you need to give the exact folderID (and fileIDs) in both the first and second step, and not the folder name for such commands to work.
The command syntax to use for the transfer is:

gam user t...@acme.org update drivefileacl 0B8aCWH-xLi2NckxXOEp5REUtNEE sa...@acme.org role owner transferownership true

It's also available in a more flexible command in another version of GAM, called GAMADV-X.

Check GamCommands.txt for syntax for the command claim.
There you give the folderID to begin with, and it will claim all folders and files recursively.


Reply all
Reply to author
Forward
0 new messages