Which GAM to use?

327 views
Skip to first unread message

Richard Cooke

unread,
Feb 26, 2021, 9:40:16 AM2/26/21
to GAM for Google Workspace

Hi all!

Really happy to discover GAM!  Saves me from having to cobble together my own package!

But there seems to be several variants.  What are the differences between them?

Or simply, which one should I start with?  My primary interest is to catalog all user's My Drive files - its been discovered a lot of staff have different versions of the same file!  So I was told to make a master catalog so it can be decided which person's copy of each file is the latest.

I plan to round them up onto Shared Drives so this does not happen again....


Thanks in advance,
Richard.

Ian Crew

unread,
Feb 26, 2021, 10:20:55 AM2/26/21
to google-ap...@googlegroups.com
Personally, my vote would be for GAMADV-XTD3 (https://github.com/taers232c/GAMADV-XTD3) it’s a superset of the standard GAM and offers lots of handy additional functionality. Both Jay (the creator of GAM) and Ross (the creator of GAMADV-XTD3) hang out here and are endlessly helpful.

Welcome!

Ian

--
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/a49e3fed-d474-42cb-bfa9-e6db74773932n%40googlegroups.com.
--
Ian Crew

Solutions Architect
Productivity & Collaboration Services
Information Services and Technology

Richard Cooke

unread,
Feb 26, 2021, 10:38:21 AM2/26/21
to GAM for Google Workspace
Thanks Ian!  This is another account for me.  Both are clients I work for.  My personal gmail account is rcooke1963.

Can I sponge any tips off you for generating a "My Drive" file catalog?  heheheh  Or am I condemed to reading.  Acutally, even what to read would be helpful. 

Thanks in advance!
Rich.

Ian Crew

unread,
Feb 26, 2021, 10:41:43 AM2/26/21
to google-ap...@googlegroups.com

Ross Scroggs

unread,
Feb 26, 2021, 12:30:43 PM2/26/21
to google-ap...@googlegroups.com
Richard,

This will be easier faster with Advanced GAM.

gam config auto_batch_min 1 redirect csv ./AllUsersFiles.csv multiprocess all users print filelist fields id,name,mimetype,...


# config auto_batch_min 1 - enable parallel processing

# redirect csv ./AllUsersFiles.csv multiprocess - Redirect out, handle multiple processes

# all users - The whole gang

# print filelist fields id,name,mimetype,... - What fields you want, replace ... with additional fields


Ross


On Fri, Feb 26, 2021 at 6:40 AM Richard Cooke <rcook...@gmail.com> wrote:
--
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/a49e3fed-d474-42cb-bfa9-e6db74773932n%40googlegroups.com.


--

Richard Cooke

unread,
Feb 26, 2021, 2:39:53 PM2/26/21
to GAM for Google Workspace
Thanks Ross, but which project is "Advanced GAM"?

Ross Scroggs

unread,
Feb 26, 2021, 2:41:32 PM2/26/21
to google-ap...@googlegroups.com

Richard Cooke

unread,
Feb 26, 2021, 2:44:53 PM2/26/21
to GAM for Google Workspace
ah ok.  thanks.  looks like the same one Ian mentioned.  and I am busily working on setting up on my Dev laptop....

Marsh Giguere

unread,
Feb 26, 2021, 2:51:42 PM2/26/21
to google-ap...@googlegroups.com
https://github.com/taers232c/GAMADV-XTD3

Maj Marshall E. Giguere, CAP
NH Wing Director of IT
U.S. Air Force Auxiliary
 


Richard Cooke

unread,
Feb 26, 2021, 9:20:09 PM2/26/21
to GAM for Google Workspace
I just ran through the NEW version installer script.  Wow.  Just Wow.

This is my Debian 10 Dev laptop, I'm a Python programmer so I have all kinds of tools already installed.  But still, its amazing to see an installer and setup script that actually works 100%!

Even handling the needed diversions to a web browser for Google stuff.  Only "issue" is when it tries to open the first link to get going, Chrome or Firefox always seem to ignore the "auth" spec, and default to my own home account instead of the work account the link actually specifies.  I've run into this before, so I know how to fiddle with the browswer to get it to work.  Otherwise, that first link had me authorise my home account. So the install script just cycles back to the same "use this link" prompt.  

But still, the silly thing is fully installed and appears to work.

Now I just have to figure out how to use to accomplish my task.

But Kudos to everybody that has contributed to that installer.  Wow.

Marsh Giguere

unread,
Feb 26, 2021, 10:07:53 PM2/26/21
to google-ap...@googlegroups.com
Richard;

> Now I just have to figure out how to use to accomplish my task.

It all depends on your use pattern.  I can speak only for myself and my pattern may be a bit idiosyncratic compared to other users here.  I use GAM for a lot of simple one-off management command line stuff like resetting passwords, etc.  For the general large scale management tasks I have a large MongoDB database surrounded by a management application that consists of some Python and a lot of JS code.  No matter which application is running they all compile instructions down to a series of GAM commands which get stuffed into a batch file and then sent to a job queue which executes the batch files on a cron schedule.  This all runs up on a cloud instance. 

The most common use pattern I see is to use gam to suck some information out of WorkSpace as a csv, or spreadsheet, massage it into a csv file and then use gam's batch processing capability feature to do your job.  I use this model rarely, again my use pattern is probably the odd one out.

V/r

PS  I'm an old, and I do mean old, Linux/*NIX dev/admin :D

Maj Marshall E. Giguere, CAP
NH Wing Director of IT
U.S. Air Force Auxiliary
 
On Fri, Feb 26, 2021 at 7:20 PM Richard Cooke <rcook...@gmail.com> wrote:
I just ran through the NEW version installer script.  Wow.  Just Wow.

This is my Debian 10 Dev laptop, I'm a Python programmer so I have all kinds of tools already installed.  But still, its amazing to see an installer and setup script that actually works 100%!

Even handling the needed diversions to a web browser for Google stuff.  Only "issue" is when it tries to open the first link to get going, Chrome or Firefox always seem to ignore the "auth" spec, and default to my own home account instead of the work account the link actually specifies.  I've run into this before, so I know how to fiddle with the browswer to get it to work.  Otherwise, that first link had me authorise my home account. So the install script just cycles back to the same "use this link" prompt.  

But still, the silly thing is fully installed and appears to work.

Now I just have to figure out how to use to accomplish my task.

But Kudos to everybody that has contributed to that installer.  Wow.

[snip]

Gabriel Clifton

unread,
Feb 26, 2021, 10:28:10 PM2/26/21
to google-ap...@googlegroups.com
Just start small and work your way to the big pulls. I started small with just a few queries to familiarize myself with what it could do. Now I have several scheduled tasks that pull all kinds of reports for me.

Cent frm my fone, I so tipos wth s nrml keybird. U xpect me d0 bttr wth a smallr keybord?

--
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.

Richard Cooke

unread,
Feb 28, 2021, 9:56:57 PM2/28/21
to GAM for Google Workspace
Thank you again Ross!

So far I figured outhow to get a CSV list of each users files. But it turns out some users have so many files it chokes the gam function to generate a list!
(gam all users show filelist todrive allfields)

So now I need to come up with a file space report for each user: number of files and size with totals by folder.  To see how much stuff our users have in there. Then I guess I will have to figure out how many are duplicates, copied from another user's shared folder. Followed by trying to track down changed versions.

I'm trying to figure out how to use thie auto-batch-min function.  I feel this would be eaiser if I made a top level Python program that called the GAM functions and parsed the returns.  Or maybe when called as a function, it reutrns Json?

The installer script I ran seems to have installed an executible binary file for my Debian. If I check out the latest GIT repo I can run it from source, then import it into my own script?

Thanks in advance,
Rich.





On Friday, February 26, 2021 at 12:30:43 PM UTC-5 Ross Scroggs wrote:

Brian Kim

unread,
Mar 1, 2021, 12:35:38 PM3/1/21
to GAM for Google Workspace
Hi Rich,

Getting the size of the folder would be difficult. 

https://developers.google.com/drive/api/v3/reference/files Size is only reported for binary file types, and it counts against users storage only if they on it. Just because something is in a folder they own, it does not mean that all the files within the folder are owned by the user.

Richard Cooke

unread,
Mar 1, 2021, 5:07:37 PM3/1/21
to GAM for Google Workspace
Thats fine, I would not want to double count files for each user that has access.  Just the "one" user that owns them.  That would also prevent me from worrying if their copy is changed too. Unless they copy the shared file out of the shared folder into one of their folders.  And then they would become owner, so it should be counted.  Figuring out if its a later revision will be next headache.

I think, but am not sure, it will turn out one user owns "everything".

Kim Nilsson

unread,
Mar 2, 2021, 12:33:55 PM3/2/21
to GAM for Google Workspace
Richard,

one way to improve the community and the quality of threads like this, is to whenever you say learnt how to do a new thing, post it. :-)

Then everyone reading this will know what you know, and we'll all be better off.

We'll also be able to give feedback on your choice or potential syntax improvements.
Reply all
Reply to author
Forward
0 new messages