Use GAM to print Shared Drive Owners and Files shared to Externals via Public Link Sharing

139 views
Skip to first unread message

Leonardo Barbosa

unread,
Feb 26, 2025, 5:18:28 AMFeb 26
to GAM for Google Workspace
Hello everyone!

I have a list of over 10000+ Shared Drives in my Google Workspace organization (names and IDs), which I need the following information:
- Who are the Managers of this Shared Drive
- A Count of how many files inside of these Shared Drives are shared via public link sharing "Anyone with Link"

A few questions from my side regarding that:
- Is it possible to retrieve this data without my Super Admin user being added as a Manager of each one of these Shared Drives? Or the API doesn't allow me to do that?
- If it is possible, how can I do this with GAM?

I know that for end users I can use something like this:
gam ou_and_children "OU_where_the_users_are_found" print filelist fields id,name,permissions,webViewLink query "visibility='anyoneWithLink'" todrive

But I couldn't find how to do this with Shared Drives. (I have this list of 10000+ Shared Drives in a CSV file, in case this helps somehow).

Thank you for the help as always!

Maj. Marshall Giguere

unread,
Feb 27, 2025, 1:40:12 PMFeb 27
to google-ap...@googlegroups.com
This is what I use:

gam redirect csv - print teamdrives fields id | gam redirect  csv ./allOrganizers.csv  multiprocess csv - gam print drivefileacls teamdriveid ~id   role organizer oneitemperrow fields emailaddress

--
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 visit https://groups.google.com/d/msgid/google-apps-manager/741b1c5f-9e19-4986-9c5b-433bd9758fffn%40googlegroups.com.

Ross Scroggs

unread,
Feb 27, 2025, 2:19:30 PMFeb 27
to google-ap...@googlegroups.com
Let's assume you have a CSV file SharedDrives.csv with these two columns: manager,id

gam redirect csv ./SDAnyoneShares.csv multiprocess redirect stderr - multiprocess csv ./SharedDrives.csv gam user "~manager" print filelist select teamdriveid "~id" fields driveid,id,name,permissions,mimetype,webviewlink showdrivename query "visibility='anyoneWithLink'" pmfilter oneitemperrow

Ross
----
Ross Scroggs



Ivan Carlos

unread,
Mar 8, 2025, 1:40:36 PMMar 8
to google-ap...@googlegroups.com
Hi masters,

When I run this command, iot returns:

c:\GAM7>gam redirect csv ./SDAnyoneShares.csv multiprocess redirect stderr - multiprocess csv ./SharedDrives.csv gam user "~manager" print filelist select teamdriveid "~id" fields driveid,id,name,permissions,mimetype,webviewlink showdrivename query "visibility='anyoneWithLink'" pmfilter oneitemperrow
ERROR: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

Am I doing something wrong? :/



Ross Scroggs

unread,
Mar 8, 2025, 2:03:02 PMMar 8
to google-ap...@googlegroups.com

Try: 
... 
csv ./SharedDrives.csv charset utf-8-sig ...

Ross
----
Ross Scroggs


Ross Scroggs

unread,
Mar 9, 2025, 10:36:30 AMMar 9
to google-ap...@googlegroups.com
Try 
csv ./SharedDrives.csv charset utf-16 ...

----
Ross Scroggs


Reply all
Reply to author
Forward
0 new messages