Adding Folders/Files to Shared Drive Folders

751 views
Skip to first unread message

George Lawson-Crowson

unread,
Aug 9, 2017, 3:44:47 PM8/9/17
to google-ap...@googlegroups.com
Hey all. I'm trying to add folders/files on a local Linux server to a shared drive folder. However, when GAM searches for the folder it only searches folders/files owned by me. Is there a way to search for shared folders? Do I need to use gamadvx?

gam version: 3.61

gam command:
gam user crow...@southwestern.edu add drivefile localfile "delete_me.txt" drivefilename "delete_me.txt" parentname "Shared Drive Folder"

gam output:
Searching for files with query: "mimeType = "application/vnd.google-apps.folder" and "me" in owners and title = "Shared Drive Folder""...
 got 0 files...

Sincerely,
George Crowson
Systems Developer
Southwestern University

Ross Scroggs

unread,
Aug 9, 2017, 4:32:03 PM8/9/17
to google-ap...@googlegroups.com
George,

The best you can do short run is get the id for the parent folder "Shared Drive Folder"; the id will be the same for all users.

gam user crow...@southwestern.edu print filelist fullquery "title='Shared Drive Folder'" id

Get the id from the output.

gam user crow...@southwestern.edu add drivefile localfile "delete_me.txt" drivefilename "delete_me.txt" parentid <put id here>

Gam 3.61 is very old, I'd suggest updating to the current version.

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAOdSnKovvtK4d8tezK5%3D%3DjjrzFbGo0CHWurCzsP7JDtCLqG0OA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.



--

George Lawson-Crowson

unread,
Aug 9, 2017, 5:02:31 PM8/9/17
to google-ap...@googlegroups.com
Thanks for the heads up, I didn't realize we were so out of date. I'll work with the sysadmin to get GAM updated. The command for getting the folder ID only returns crow...@southwestern.edu -- but maybe that's because we're out of date?

George

On Wed, Aug 9, 2017 at 3:31 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
George,

The best you can do short run is get the id for the parent folder "Shared Drive Folder"; the id will be the same for all users.

gam user crow...@southwestern.edu print filelist fullquery "title='Shared Drive Folder'" id

Get the id from the output.

gam user crow...@southwestern.edu add drivefile localfile "delete_me.txt" drivefilename "delete_me.txt" parentid <put id here>

Gam 3.61 is very old, I'd suggest updating to the current version.

Ross
On Wed, Aug 9, 2017 at 12:31 PM, George Lawson-Crowson <crow...@southwestern.edu> wrote:
Hey all. I'm trying to add folders/files on a local Linux server to a shared drive folder. However, when GAM searches for the folder it only searches folders/files owned by me. Is there a way to search for shared folders? Do I need to use gamadvx?

gam version: 3.61

gam command:
gam user crow...@southwestern.edu add drivefile localfile "delete_me.txt" drivefilename "delete_me.txt" parentname "Shared Drive Folder"

gam output:
Searching for files with query: "mimeType = "application/vnd.google-apps.folder" and "me" in owners and title = "Shared Drive Folder""...
 got 0 files...

Sincerely,
George Crowson
Systems Developer
Southwestern University

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Ross Scroggs

unread,
Aug 9, 2017, 5:30:06 PM8/9/17
to google-ap...@googlegroups.com
George,

You can get the Id this way.
In Google Drive,
right-click on Shared Drive Folder
click Share...
click Advanced
Link to Share: https://drive.google.com/drive/folders/<ID is Here>?usp=sharing
click Done

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--

Ross Scroggs

unread,
Aug 11, 2017, 10:28:41 AM8/11/17
to google-ap...@googlegroups.com
George,

you would do the following:

gam user crow...@southwestern.edu add drivefile localfile "delete_me.txt" drivefilename "delete_me.txt" sharedparentname "Shared Drive Folder"

GAM-B is a drop-in replacement for GAM, GAMADV-X and GAMADVX-TD (full TeamDrive support) use your existing project, client_secrets.json and oauth2service.json files. You generate a new oauth2.txt file.

Ross





--



--

George Lawson-Crowson

unread,
Aug 11, 2017, 11:03:19 AM8/11/17
to google-ap...@googlegroups.com
Awesome! Thank you, Ross! That'll solve my problems perfectly. The manual folder-id lookup didn't work because I'm trying to automate nested folder creation.

I'm curious if GAMADV-X and GAMADV-XTD are forks that'll merge back into GAM at some point? Are they independently updated?

Thanks again,
George

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Ross Scroggs

unread,
Aug 11, 2017, 11:30:46 AM8/11/17
to google-ap...@googlegroups.com
George,

GAMADV-X and GAMADV-XTD are based on a fork of Jay's code from way back but they are a complete rewrite and are now independent.

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages