We can use https://github.com/GAM-team/GAM to create catalogues of Google Drive files by drive location, owner, last modified time, etc. I’ve run all the calls below using legacy GAM, but we might consider using GAM7 instead.
First, some useful resources:
A hello world call that prints a list of all the files in a shared drive:
gam user <admin email> print filelist select teamdrive '<drive name>' showownedby any id title filepath viewed modifieddate
Modifying the call to add some links per file:
gam user <admin email> print filelist select teamdrive '<drive name>' showownedby any id title filepath modifieddate alternatelink webviewlink webcontentlink > <outfile name>.csv
It is possible to print filelist for files across all shared drives:
gam user <admin email> print filelist corpora onlyteamdrives fields id title filepath modifieddate alternatelink webviewlink webcontentlink driveId > <outfile name>.csv
Now, we can group this file list by driveId on the most recent modifiedtime to see all Shared Drives by most modifiedtime
To get a list of Shared Drive names and ids, we need to first grab our top level Organizational Unit's orgUnitId:
gam info org "/"
which should return something like:
Organizational Unit: /
orgUnitId: <id>
name: <should match what you see in admin.google.com>
description: <should match what you see in admin.google.com>
Users:
...
We can now query for all teamdrives in that Organizational Unit:
gam print teamdrives query "orgUnitId='<id>'" fields id,name,orgunit,createdtime
first, grab the id for the File sensitivity label:
gam show drivelabels
Then, grab all files with this label:
gam config csv_output_row_filter "labels:count>0" user <admin email> print filelist corpora onlyteamdrives fields id,name,webViewLink showlabels ids includelabels <insert comma separated list of IDs here>