Folder hierarchy of my drive

412 views
Skip to first unread message

Jacques Bugeja

unread,
Dec 16, 2021, 6:07:00 AM12/16/21
to GAM for Google Workspace
I need to get the entire folder hierarchy for all user's my drive to be able to identify the critical folders of the company and prepare a migration for these critical folders. It is important that the list:
- does not include shortcuts
- does not include  files/folders which were added to drive "add to drive"
- includes all folders on that drive irrelevant of who is the owner

I tried some ways how to gather this info but was not able to gather the exact output I want. Is there a way I can get this info? or perhaps some different approach?

Thanks and regards
Jacques

Kim Nilsson

unread,
Dec 16, 2021, 7:55:43 AM12/16/21
to GAM for Google Workspace
There should be ways to include and exclude what you (don't) want.

Check this topic (and the following) in the GAMADV-XTD3 wiki for types of files.

Then maybe also using the csv output feature to include and exclude those you (don't) want.

Ross Scroggs

unread,
Dec 16, 2021, 10:43:51 AM12/16/21
to google-ap...@googlegroups.com
Jacques,

Report: gam version

What commands have you tried?

--
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/a2f062d3-a8ff-4a52-a1f4-6edfb257c018n%40googlegroups.com.

Jacques Bugeja

unread,
Dec 16, 2021, 11:40:39 AM12/16/21
to GAM for Google Workspace
Hi Ross,

GAM version: GAMADV-XTD3

I tried this command and was able to get the data I need: gam user jacques...@haud.com show filetree showmimetype gfolder fields id,mime,mimetype,owners,parents excludetrashed > file.csv

Now I need to run for all users: gam all users show filetree showmimetype gfolder fields id,mime,mimetype,owners,parents excludetrashed > foldertree.csv

However the issue I am encountering now is that the above cmd gets all data from all 3 domains. I need the data just of a particular domain. Didn't manage to find how.

Can you kindly assist?

Thanks!
Jacques

Ross Scroggs

unread,
Dec 16, 2021, 12:00:16 PM12/16/21
to google-ap...@googlegroups.com
Jacques,

This gives a text file with indentation; I dropped mime as mime and mimetype are synonyms
gam redirect stdout ./foldertree.txt domains xyz.com show filetree showmimetype gfolder fields id,mimetype,owners,parents excludetrashed

This gives a csv file; I changed mine to name in order to get folder name
Serial processing
gam redirect csv ./foldertree.csv domains xyz.com print filelist showmimetype gfolder fields id,name,mimetype,owners,parents excludetrashed
Parallel processing
gam config auto_batch_min 1 redirect csv ./foldertree.csv domains xyz.com print filelist showmimetype gfolder fields id,name,mimetype,owners,parents excludetrashed

Ross

Jacques Bugeja

unread,
Dec 16, 2021, 2:06:48 PM12/16/21
to GAM for Google Workspace
This worked quite well:
gam redirect stdout ./foldertree.txt domains xyz.com show filetree showmimetype gfolder fields id,owners,parents excludetrashed

The only thing is that users who selected "add to drive" will also display these folders in the output. However with id and owner I'm able to know/identify these "duplicate" folders.

Thanks you Ross - Much appreciated.

Regards
Jacques

Reply all
Reply to author
Forward
0 new messages