Share the entire "My drive" directory with another user

570 views
Skip to first unread message

Arnaud Lienard

unread,
Jul 17, 2023, 5:18:03 AM7/17/23
to GAM for Google Workspace
Hi,

Could you please tell me what the command is to share the entire "My drive" directory with another user?

Example 

- I would like User1 to share his entire "My drive" directory with User2
- User1 must remain the owner and User2 must have the "Writer" role.

I've only found a command to share a directory in "My drive" and not the entire directory as I'd like.

Thank you for your help
Arnaud

Maj Marshall Giguere

unread,
Jul 17, 2023, 9:08:33 AM7/17/23
to google-ap...@googlegroups.com

The driveFileEntity for a My Drive is mydrive or root

>gam user User1 add drivefileacl mydrive role writer user User2


This sounds like a use case for a shared drive.


Please consider the environment before printing this e-mail.

Information in this message is confidential and is intended solely for the persons to whom it is addressed. If you are not the intended recipient please notify the sender and immediately delete this message from your computer.

This system may be monitored or recorded to secure the effective operation of the system and for other lawful purposes.  Please check out the Privacy Notice on our website for details.

--
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/6061df42-5513-41d4-9fd9-564746ebe158n%40googlegroups.com.

Arnaud Lienard

unread,
Jul 17, 2023, 10:24:58 AM7/17/23
to GAM for Google Workspace
Hi Maj Marshall Giguere,

Thanks for your help

I tried the commands below :

- gam user User1 add drivefileacl mydrive user User2 role writer
- gam user User1 add drivefileacl root user User2 role writer

The commands run but return the error message "Add Failed: This file is never writable".

Any ideas? 

Regards
Arnaud

Ross Scroggs

unread,
Jul 17, 2023, 10:35:42 AM7/17/23
to google-ap...@googlegroups.com
A Shared Drive is the best approach but here are the commands to share the My Drive

# Get filelist for user a                                                                                                                                                                     

gam redirect csv ./filelist.csv user user@@domain.com print filelist fields id,name,mimetype

Getting all Drive Files/Folders that match query ('me' in owners) for us...@domain.com

Got 257 Drive Files/Folders that matched query ('me' in owners) for us...@domain.com...

# Add an ACL to every file/folder for user b                                                                                                                                                  

$ gam redirect stdout ./sharefilelist.txt multiprocess redirect stderr stdout csv ./filelist.csv gam user "~Owner" add drivefileacl "~id" user us...@domain.com role writer


Ross




--

Maj Marshall Giguere

unread,
Jul 17, 2023, 11:34:25 AM7/17/23
to google-ap...@googlegroups.com
I thought it was worth a try.  You may not be able to share an entire mydrive.

You couldt to move all the folders/files into a sub-folder and share that.  I suggest moving everything to a shared drive.

Maj Marshall E Giguere

NH Wing Director of IT

Civil Air Patrol, U.S. Air Force Auxiliary

GoCivilAirPatrol.com

nhwg.cap.gov

Volunteers serving America's communities, saving lives, and shaping futures.



Arnaud Lienard

unread,
Jul 17, 2023, 12:51:43 PM7/17/23
to GAM for Google Workspace
Maj Marshall Giguere , Ros,

I'm going to follow your advice and use a shared drive.

Thank you both for your advice

Arnaud

Le lundi 17 juillet 2023 à 17:34:25 UTC+2, Maj Marshall Giguere a écrit :
I thought it was worth a try.  You may not be able to share an entire mydrive.

You couldt to move all the folders/files into a sub-folder and share that.  I suggest moving everything to a shared drive.

Maj Marshall E GiguereNH Wing Director of ITCivil Air Patrol, U.S. Air Force Auxiliary
Reply all
Reply to author
Forward
0 new messages