Any way to show a list of all files in a folder?

6,866 views
Skip to first unread message

AMoreno

unread,
May 5, 2016, 1:27:06 PM5/5/16
to Google Apps Manager
Hi all,

I was toying with the idea of migrating our local network shares to Google Drive per this: https://apps.google.com/learning-center/products/drive/set-up-file-share/

However, during the process and testing, I realized that once we grant users "Can Edit" permissions to their respective department's folders, unless the "Prevent editors from changing permissions" box is checked (which I can't see a way to make that default), any user with Can Edit permissions can remove everyone's access, except the owner. Our admin account can migrate the files to the departments' shares, making them the owner of those files, but any new files that get created would be owned by whoever created them. And then, if the owners of those files wanted to, could remove our admin account from having access to those files.

So there's kinda two parts here:

First, is there any way to use gam to show a list of ALL files/folders inside of another folder, regardless of ownership/permissions (I am a super admin) and subsequently, apply the "writerscantshare" parameter to all of them?
Second, is there a way to update permissions on ALL files/folders inside of another folder with the writerscantshare parameter, or to add our admin account with "Can Edit" or Owner permissions?

I guess a third question - how are other institutions handling a centralized file share?

I'm not trying to be big brother here. I'm trying to have a way for us to help our end users when they call our help desk saying that they no longer have access to a file they previously had access to. Then we find out that another user accidentally changed permissions on an entire folder instead of a single file.

Also, is there a way to force all files in a folder to inherit permissions from their parent folder?

I guess the TL;DR is, is there a way to make Google Drive act like Windows NTFS? =)

Thanks in advance
Message has been deleted

David Herraiz Sanabria

unread,
May 9, 2016, 7:36:50 AM5/9/16
to Google Apps Manager
Hi!

You can search all files of all users with the following command and generate a csv file to use.

gam all users show filelist id > files.csv

After you can run  the following command to update all files

gam csv files.csv gam all users update drivefile ~id writerscantshare

If you have a lot of files and users this task may to take a long time.

Anyway you can see the documentation, 




Regards

AMoreno

unread,
May 9, 2016, 3:19:05 PM5/9/16
to Google Apps Manager
Thanks David. I was aware of that command, however, I was hoping there was a way to limit the scope of that search to, all files for all users in a specific folder, within the context of a centralized file repository as laid out by the Google tutorial page I linked. The command you listed will list all files for all users within our Google Apps domain. We've probably got a gajillion files. I'd ideally like to limit the scope of that to a specific folder and all child objects (files and folders) recursively therein.

I looked through the documentation, but couldn't find the right combination of switches for the "show filelist query" command to meet the criteria mentioned above.

S.Smiles

unread,
May 9, 2016, 4:33:10 PM5/9/16
to Google Apps Manager
Hi

Maybe Jay Lee can say us if there are some way to search parents and childrens in a specific folder. Cause when you use the query "'IDofFolder' in parents"  unfortunately only show the files and folders that you designated with IDofFolder parameter.


Regards

Ed Hillis

unread,
May 10, 2016, 1:08:55 PM5/10/16
to google-ap...@googlegroups.com
It's not GAM, but I would see if GAT -- https://generalaudittool.com/ -- has this capability. If so I would use GAT to produce a csv of document IDs and then give that to GAM to process.

Ed


--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@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/0555c3b9-63aa-4708-972f-7ca95c8137c7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ed Hillis
Web Programmer, Information Services
Southwestern University

AMoreno

unread,
May 10, 2016, 2:06:06 PM5/10/16
to Google Apps Manager
Ed, thanks for that. I will look into it. We are a higher education institution, so if it truly is free as they say on their website, that could be a valuable resource even if it doesn't necessarily address this issue fully in the way I would like. I'll have to do a bit more research, but it's possible your solution could work.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Ed Hillis

unread,
May 10, 2016, 2:12:07 PM5/10/16
to google-ap...@googlegroups.com
Yes, it's useful in places for us. We just used it in the way I described to do a recursive ownership transfer of the folders/files in a particular folder. The recursion was the thing that was tripping us up with GAM.


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



--
Ed Hillis
Web Programmer, Information Services
Southwestern University

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

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

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

David Herraiz Sanabria

unread,
May 11, 2016, 6:50:57 AM5/11/16
to Google Apps Manager
Ed, thanks

I've been looking that tool I have a doubt Can you produce a csv with free edition?

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

Ed Hillis

unread,
May 11, 2016, 9:56:20 AM5/11/16
to google-ap...@googlegroups.com
Qualified yes. The version we're using is free for edu. 


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



--
Ed Hillis
Web Programmer, Information Services
Southwestern University

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

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

For more options, visit https://groups.google.com/d/optout.
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

mattias.bystedt

unread,
May 11, 2016, 3:36:42 PM5/11/16
to Google Apps Manager
I have made a fork of GAM with a new command "claim", in which you specify a folder and recursively transfer all files/folders within to a specific owner (the listing of files is done from the "claiming" users drive - so this user must be able to "see" files or they won't get transferred), I also added a switch [writerscantshare] to "Prevent editors from changing permissions" on files that get transferred to the new owner.

Ed Hillis

unread,
May 11, 2016, 4:55:15 PM5/11/16
to google-ap...@googlegroups.com
Thank you, Mattias!

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

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

Andrew Birch

unread,
Jul 18, 2016, 3:31:29 AM7/18/16
to Google Apps Manager
Hi there, I hope this is not considered a hi-jack of your discussion.  I too have a requirement to look at all files in a folder.  Specifically, I've been asked by auditors for a list of files within a particular folder, and its sub-folders, which can be accessed from outside our organisation.  My immediate stumbling block is that I cannot recursively list the files in the folder, so I cannot determine which files are in scope for the question.

Is there any advice out there?  I'm on GoogleApps unlimited, and I'm a super admin, but I've failed in GAM to relate files to their parent folders.  I don'r care about files outside that folder, and I've over 200k of them!  I know there are 1700 files that can be read by anyone with a link, but I don't know which of these are within the folder in question.

Many thanks,
Andrew.

Michael Harris

unread,
Sep 25, 2017, 2:04:17 PM9/25/17
to GAM for G Suite
Been about a year on this thread but since I just needed to do this myself I thought I would post my answer. 

Used this command to list all activity in a folder and then used the Google Sheets Unique function to generate a list of Drive Target id and Document Names which are Col C & D of the OutputFile.csv.

C:\GAM>gam user %em...@domain.com% show driveactivity folderid %FOLDERID% > OutputFile.csv


%em...@domain.com% = Email of editor of folder
%FOLDERID% = Folder ID i.e. https://drive.google.com/drive/folders/0B_S3LbJNDotP32DBY0p6VkxocXM the part shown in Bold is the Folder ID. 


This may not be the cleanest way to get the information but it does work.

Good Luck GAMing

Mikhail S.

unread,
Sep 26, 2017, 5:34:21 PM9/26/17
to GAM for G Suite
GAM Advanced has this functionality out of the box.

C:\gamadv-x>gam user owner_of_root_folder show filelist select folder_ID showownedby any
Reply all
Reply to author
Forward
0 new messages