Gam Command for exporting all Google Shared Drives/Team Drives and their owners

3,680 views
Skip to first unread message

Brian Evans

unread,
Jan 20, 2022, 6:07:43 AM1/20/22
to GAM for Google Workspace
Hi there,

Just looking for a Gam ADV command that will allow me to export all Google Shared Drives/Team Drives and their owners.

I have tried gam print teamdriveacls oneitemperrow to drive and gam user <Email address>  print teamdrives [todrive] but this will only pull back a certain users shared drives.

I am looking for a command that will just export all shared drives with their owners and not on a user by user basis.

Thanks,
Brian

Ian Crew

unread,
Jan 20, 2022, 8:43:48 AM1/20/22
to google-ap...@googlegroups.com
Hi Brian:

There was a thread here a couple of weeks ago that answers your question, I think:

Note that shared drives don’t have owners—they’re “owned” by the organization as a whole, and managed by the folks that have manager privileges. 

Hope that helps,

Ian

--
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/43f9313f-4fa2-4e2b-be09-3dd952883937n%40googlegroups.com.
--
Ian Crew

Solutions Architect
Productivity & Collaboration Services
Information Services and Technology

Brian Evans

unread,
Jan 20, 2022, 9:19:46 AM1/20/22
to google-ap...@googlegroups.com
Hi Ian,

Thanks.

I mean this sort of works, it will just not print the managers of the shared drives. So I have done gam print shareddrives fields id,name role manager todrive and it prints the shared drives to a file, but only the shared drives and not the managers.

Any ideas why?

Many thanks,
Brian

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/fIc4_F0Y8-Y/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAD2sLFtNpndY9%2BaDNpNCdf__eLwOmHoBSb7L2JAe-1ryFkT2tw%40mail.gmail.com.

Ross Scroggs

unread,
Jan 20, 2022, 9:19:54 AM1/20/22
to google-ap...@googlegroups.com
Brian,

gam config csv_output_header_filter "id,name,permission.emailAddress,permission.role" redirect csv - todrive print teamdriveacls oneitemperrow role organizer

Ross

Ross Scroggs

unread,
Jan 20, 2022, 9:44:45 AM1/20/22
to google-ap...@googlegroups.com

Brian Evans

unread,
Jan 20, 2022, 9:54:19 AM1/20/22
to google-ap...@googlegroups.com
Hi Ross,

This works better. Gives me more information than I tried previously from Ian Crew.

Thanks,
Brian

You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/fIc4_F0Y8-Y/unsubscribe.
To unsubscribe from this group and all its topics, 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/7853052D-0626-42BD-913E-124E2DD89B4A%40gmail.com.

Brian Evans

unread,
Jan 21, 2022, 4:38:17 AM1/21/22
to google-ap...@googlegroups.com
Hi Ross,

In addition to this, I have looked at your link below, but I cannot seem to find a command that will allow me to see when the shared drives were created and their members?

So really, what I now need is a GAM ADV command that will show me all shared drives with the date created, its members and roles, if possible please. Not sure what needs to be added to the below command to include date created and members:

gam config csv_output_header_filter "id,name,permission.emailAddress,permission.role" redirect csv - todrive print teamdriveacls oneitemperrow role manager todrive.

Can you help?

Many thanks,
Brian

Ross Scroggs

unread,
Jan 21, 2022, 9:55:07 AM1/21/22
to google-ap...@googlegroups.com
Brian,

I'll have to update GAM to give you the created time with this command.
For now, drop role manager amd you'll get all roles.
Drop the redundany todrive at the end.

Ross Scroggs

unread,
Jan 21, 2022, 2:13:01 PM1/21/22
to google-ap...@googlegroups.com
Brian,

6.14.02 now includes the creation time.

Ross
--

Colleen Schmidt

unread,
Jan 27, 2022, 12:44:09 PM1/27/22
to GAM for Google Workspace
Hi Ross,

What switch/option would I add to the command to get the creation time?

gam config csv_output_header_filter "id,name,permission.emailAddress,permission.role" redirect csv - todrive print teamdriveacls oneitemperrow role manager

Thanks!

-Colleen

Ross Scroggs

unread,
Jan 27, 2022, 12:55:56 PM1/27/22
to google-ap...@googlegroups.com
Colleen,

gam config csv_output_header_filter "id,name,createdTime,permission.emailAddress,permission.role" redirect csv - todrive print teamdriveacls oneitemperrow role manager

Ross

Maj Marshall Giguere

unread,
Jan 27, 2022, 1:24:34 PM1/27/22
to google-ap...@googlegroups.com
if you add the attribute "createdtime" I think that will work.  Unless Ross exports the value by default.
--
Maj Marshall E Giguere
NH Wing Director of IT
Civil Air Patrol, U.S. Air Force Auxiliary




Volunteers serving America's communities, saving lives, and shaping futures.


Colleen Schmidt

unread,
Jan 27, 2022, 3:15:22 PM1/27/22
to GAM for Google Workspace
Thank you, it worked like a charm!

-Colleen

Ivan Carlos

unread,
Mar 20, 2023, 4:01:53 AM3/20/23
to GAM for Google Workspace
Hi team,

I am looking to apply this solution without sucess : I run "gam all users print shareddrives todrive" but it does not generate the user ID/e-mail on each line/permission, and when I run "gam config csv_output_header_filter "id,name,createdTime,permission.emailAddress,permission.role" redirect csv - todrive print teamdriveacls oneitemperrow role manager"

but I get an error that config is not a valid argument

Please, how can I run this command to generate the full shared drive report?

Thanks a lot and regards

Ross Scroggs

unread,
Mar 20, 2023, 9:05:18 AM3/20/23
to google-ap...@googlegroups.com
You're runninf Standard GAM, the second command requires Advanced GAM.


Ross
----
Ross Scroggs



Ivan Carlos

unread,
Mar 20, 2023, 1:01:52 PM3/20/23
to GAM for Google Workspace
Thank you!
Reply all
Reply to author
Forward
0 new messages