Find My Drive Folder ID for Specific User

2,313 views
Skip to first unread message

Don Beck

unread,
Dec 29, 2021, 10:17:10 AM12/29/21
to GAM for Google Workspace
I am looking for a way to get the My Drive folder id for a specific user.  Once I have that, I know how to transfer ownership and move it to a shared drive.  I want to use this for when an employee leave the company

Would also be nice to run this for entire domain.

Ross Scroggs

unread,
Dec 29, 2021, 10:35:33 AM12/29/21
to google-ap...@googlegroups.com
Don,

The Drive API recognizes a user's My Drive with the id alias: root
so you don't generally need the actual id but the following will get the actual id.

Single user, Standard and Advanced
gam user testsimple show fileinfo root id

All users, Advanced, Serial
gam redirect csv ./MyDriveIds.csv all users print filelist select root fields id norecursion

All users, Advanced, Parallel
gam config auto_batch_min 1 redirect csv ./MyDriveIds.csv multiprocess all users print filelist select root fields id norecursion

Ross

On Dec 29, 2021, at 7:17 AM, Don Beck <dcb...@merig.com> wrote:

I am looking for a way to get the My Drive folder id for a specific user.  Once I have that, I know how to transfer ownership and move it to a shared drive.  I want to use this for when an employee leave the company

Would also be nice to run this for entire domain.

PLEASE NOTE
The information in this E-Mail message is legally privileged and confidential information intended only for the use of the individual(s) named above.  If you, the reader of this message, are not the intended recipient, you are hereby notified that you should not further disseminate, distribute, or forward this E-mail message.  If you have received this E-mail in error, please notify the sender. Thank you!

--
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/daf8c390-9ba8-41da-b768-6acfce159227n%40googlegroups.com.

Don Beck

unread,
Dec 29, 2021, 10:51:41 AM12/29/21
to google-ap...@googlegroups.com
Thanks Ross - exactly what I needed!!


Thanks,

Don


Don Beck

Director of Systems & Technology

Meriwether Godsey, Inc.

Meriwether Godsey

(434) 849-7323 (office)

(434) 258-1775 (cell)


 P Please consider the environment before printing this e-mail



You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/m05Cl_QtRNc/unsubscribe.
To unsubscribe from this group and all its topics, 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/5B4BE570-BE3F-4E7F-B060-69A9C2DBDB8F%40gmail.com.

Don Beck

unread,
Dec 30, 2021, 1:30:21 PM12/30/21
to google-ap...@googlegroups.com
Hi Ross

Once I have the id, I try to transfer ownership but it fails - say claim ownership failed: not found
using this command
gam user ad...@domain.com claim ownership <folder id>
What am I doing wrong?  Do I need to share admin to that folder?


Thanks,

Don


Don Beck

Director of Systems & Technology

Meriwether Godsey, Inc.

Meriwether Godsey

(434) 849-7323 (office)

(434) 258-1775 (cell)


 P Please consider the environment before printing this e-mail


On Wed, Dec 29, 2021 at 10:35 AM Ross Scroggs <ross.s...@gmail.com> wrote:
You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/m05Cl_QtRNc/unsubscribe.
To unsubscribe from this group and all its topics, 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/5B4BE570-BE3F-4E7F-B060-69A9C2DBDB8F%40gmail.com.

Kevin Brokamp

unread,
Oct 20, 2022, 11:21:44 AM10/20/22
to GAM for Google Workspace
Hi Don,
Just wondering if you ever got the claim ownership command to work in cases like these.  If so, can you please share the command you used?  This would be extremely helpful for us when moving data around in our instance.

Kevin

Don Beck

unread,
Oct 21, 2022, 12:55:10 PM10/21/22
to google-ap...@googlegroups.com
Hi Kevin

Here's what we do:

We just transfer all the data over to new ownership.  We used to claim ownership but that gets messy when they have things in their My Drive that they don't own.

So we:
1. Transfer to our Admin Account
  gam create datatransfer old...@domain.com gdrive ad...@domain.com privacy_level shared,private  

this creates folder in our Admin account My Drive
Response to command gives your transfer ID

2. gam info datatransfer <transfer id>

once it is complete then we

3.   gam user ad...@domain.com move drivefile id <My Drive Folder ID> parentid <Account Shared Drive Folder ID>
which moves in folder  and content created under out admin account to a specific shared drive   

you can also get the drive id for specific user by:   gam user <name> show fileinfo rood id

where name is na...@domain.com - only the part before the @ symbol

Hope this helps.


Thanks,

Don


Don Beck

Director of Systems & Technology


 P Please consider the environment before printing this e-mail

Reply all
Reply to author
Forward
0 new messages