List all files (csv) across all Shared Drives, including Shared Drive information

243 views
Skip to first unread message

Brandon Viertel

unread,
Jan 17, 2023, 10:50:08 AM1/17/23
to GAM for Google Workspace
Morning all, 

We are looking to report on Shared Drives across our domain. Listing Shared Drives and listing files in all Shared Drives is straight forward (https://groups.google.com/g/google-apps-manager/c/ydLlYDlabnE), however it does not include information on the Shared Drive that the file is located in. For example, I am looking for the following data:

FileID, FileName, FileSize, SharedDriveID, SharedDriveName, FileExtension

Any thoughts on a GAM command to generate a csv that includes the Shared Drive info for each record of a file across all Shared Drives?

Thanks!

Brandon

Ross Scroggs

unread,
Jan 17, 2023, 11:11:00 AM1/17/23
to google-ap...@googlegroups.com
Brandon,

gam redirect csv ./SharedDriveFiles.csv user orga...@domain.com print filelist select teamdriveid <PutDriveIDhere> fields id,name,size,fileextension,driveid showdrivename


Ross


--
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/a41f1fea-eab6-4858-b8a0-64a675c62745n%40googlegroups.com.


--

Brandon Viertel

unread,
Jan 18, 2023, 7:54:00 PM1/18/23
to GAM for Google Workspace
Ross, 

That command works perfectly. A secondary, but related issue, I am encountering is that I am combining that with the GetTeamDriveOrganizers.py script. When running the GetTeamDriveOrganizers.py script, I am getting missing Organizer data due to what I'm guessing is the manual setting of the domain. We have Shared Drives that only have members (and some with no members at all, and some with no organizers; it's a long story but we're cleaning it up now) outside of our domain, thus leaving a lot of the records in the csv generated by the GetTeamDriveOrganizers.py script with the Organizers column empty. Basically, that python script correctly generates a record with a domain matching that which is set in the python file, but leaves Shared Drives with organizers outside of that domain with an empty organizer field. Without an Organizer, it doesn't have the appropriate access to generate the list of files in the Shared Drive. This is what the python script generates for example:

SharedDriveID, SharedDriveName, Organizers
9209374823, Shared Drive 3, 
7489374773, Shared Drive 5, 

Shared Drives 3 and 5 both have Organizers that exist outside of ourdomain.com, but the python script leaves it empty.

Any thoughts on that?

Thanks!

Brandon

Ross Scroggs

unread,
Jan 18, 2023, 8:20:35 PM1/18/23
to google-ap...@googlegroups.com
Brandon,

In the GetTeamDriveOrganizers.py script, what does this line look like:

# If you want to limit organizers to a specific list of domains, use the list below, e.g., DOMAIN_LIST = ['domain.com',] DOMAIN_LIST = ['domain1.com', 'domain2.com',]           

DOMAIN_LIST = []

DOMAIN_LIST = ['ourdomain.com']


If you want organizers from anywhere, you want the first form.


Ross






--

Brandon Viertel

unread,
Jan 19, 2023, 9:53:50 AM1/19/23
to GAM for Google Workspace
Excellent, I appreciate it!
Reply all
Reply to author
Forward
0 new messages