How to transfer ownership oldOwner to newOwner via CSV

104 views
Skip to first unread message

Muhammad Iqbal

unread,
Oct 2, 2023, 7:55:16 AM10/2/23
to GAM for Google Workspace
Hi,

I have hundreds of users that im going to transfer their drive ownership to their line manager ?


But im abit confuse how to write gam command to execute this ?

suppose i put the oldowner in the row A and the newOwner in the row B 

What would be the command for this ?





The personal data (if any) contained herein is treated in accordance with the privacy policy of GoPomelo.

Maj Marshall Giguere

unread,
Oct 2, 2023, 9:45:07 AM10/2/23
to google-ap...@googlegroups.com
Muhammad;


I'm not sure this is a reasonable thing to do and possibly dangerous if mishandled.  This result will be the new owner having hundreds of new folders in their "My drive", each named for the original user.

I will assume all of the drives are to be transferred to a single new owner.

First you will need a csv file of all the users:
> gam redirect csv ./users.csv print users

You will need to verify that only the users whose drives you want to transfer are in the csv file as the above command returns all of the users for the entire workspace.  Assuming you have reviewed the "users.csv" and there is only one target owner the command is very simple:

> gam csv ./users.csv gam create transfer ~primaryEmail drive newo...@mydomain.com all

This will create a bunch of background drive transfers to "newo...@mydomain.com".  I don't know if there are any limits on the number of transfers, or files that can be transferred to a target My drive.  Your mileage may vary.

If the files will be transferred to multiple owners you will need to add a second column to the "users.csv" file, call it "NewOwner".  You will need to manually edit the "users.csv" to include the new owner for each row in the file. The the transfer command would look like this:

> gam csv ./users.csv gam create transfer ~primaryEmail drive ~NewOwner all


--
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/34bf75fa-7156-49a3-9cfa-e0ff71749c79n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages