Shared Drives

140 views
Skip to first unread message

Kevin Van Gastel_Admin

unread,
Jun 14, 2024, 5:33:05 AMJun 14
to GAM for Google Workspace
I'm trying to do an audit of al the rights on our Shared drive. When I use 
gam print teamdriveacls to drive 
This will print everything from the shared drives except for the subfolders and file underneath. Is there a way to get deeper in the shared drives? And get the rights of people on the subfolders/files? 

(I have access to all the files and all the drives I need to audit) 

Maj Marshall Giguere

unread,
Jun 14, 2024, 8:25:46 AMJun 14
to google-ap...@googlegroups.com
Kevin,

You need to walk the entire file list for the drive in question to see the permissions on each file,  if there are multiple drives you can make a csv file of drive names, feed that to GAM using "multiprocess" to create a massive list of all files, plus permissions, for all the drives.  Here's a simple one off to pull all the files for a single drive with all of the permissions for each file.

$> gam redirect csv ./shareddrivefiles.csv user orga...@mydomain.com print filelist select teamdrive drivename oneitemperrow filepath fields id,name,basicpermissions,mimetype pmfilter pm deleted false inherited false em

The "user" must have organizer privileges on the drive(s) to list.


--
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/948d0e75-4757-4264-8e3d-2f9228ea010dn%40googlegroups.com.

Kevin Van Gastel_Admin

unread,
Jun 21, 2024, 4:15:33 AM (12 days ago) Jun 21
to GAM for Google Workspace
Hey Maj, 

Thanks for your answer! For some reason I don't see to get it to work. Pretty new to GAM still. 

So I fill in my username with admin rights and the Shared Drive name. 

I always get the ERROR: Invalid argument error. 

Thanks for your help! 

Maj Marshall Giguere

unread,
Jun 21, 2024, 7:53:26 AM (12 days ago) Jun 21
to google-ap...@googlegroups.com
Sys admin's can only view the top level of a shared drive, to see all the files on a drive the user must be a user with organizer privileges on the shared drive.


Kevin Van Gastel_Admin

unread,
Jun 21, 2024, 8:05:33 AM (12 days ago) Jun 21
to GAM for Google Workspace
All our Shared Drives have an IT group as an Manager. We automatically have rights on all the files on the Shared Drives. I even tried using the IT group mailadres as an user but still got the same result. 

Ross Scroggs

unread,
Jun 21, 2024, 9:48:18 AM (12 days ago) Jun 21
to google-ap...@googlegroups.com
Gam can only use a direct user organizer/manager, a group address won't work in the API.

Ross
----
Ross Scroggs



Kevin Van Gastel_Admin

unread,
Jun 21, 2024, 10:02:46 AM (12 days ago) Jun 21
to GAM for Google Workspace
This is the error message I get when I run the command with me as an manager on the folder. 

ERROR: Invalid choice (userkevin***@****.be print): Expected <all|cigroup|cigroup_users|cigroups|courseparticipants|cros|cros_ou|cros_ou_and_children|cros_ou_and_children_queries|cros_ou_and_children_query|cros_ou_queries|cros_ou_query|cros_ous|cros_ous_and_children|cros_ous_and_children_queries|cros_ous_and_children_query|cros_ous_queries|cros_ous_query|cros_sn|croscsv|croscsv_sn|croscsvdata|croscsvfile|croscsvfile_sn|crosfile|crosfile_sn|crosqueries|crosquery|csv|csvdata|csvdatafile|csvfile|csvkmd|csvsubkey|datafile|domains|domains_ns|domains_susp|file|group|group_inde|group_ns|group_susp|group_users|group_users_ns|group_users_select|group_users_susp|groups|groups_inde|groups_ns|groups_susp|licenses|oauthuser|ou|ou_and_children|ou_and_children_ns|ou_and_children_susp|ou_ns|ou_susp|ous|ous_and_children|ous_and_children_ns|ous_and_children_susp|ous_ns|ous_susp|queries|query|students|teachers|user|users>
Help: Syntax in file /Users/kevinvangastel/bin/gamadv-xtd3/GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki

Ross Scroggs

unread,
Jun 21, 2024, 10:13:34 AM (12 days ago) Jun 21
to google-ap...@googlegroups.com
You're missing a space: user kevin***@****.be

Ross
----
Ross Scroggs


Kevin Van Gastel_Admin

unread,
Jun 24, 2024, 2:24:15 AM (9 days ago) Jun 24
to GAM for Google Workspace
Even with the space I'm still getting the same error. The space was indeed a mistake the moment I ran it on friday. 

Ross Scroggs

unread,
Jun 24, 2024, 10:19:42 AM (9 days ago) Jun 24
to google-ap...@googlegroups.com
Show the complete command and error message,

Ross
----
Ross Scroggs


Kevin Van Gastel_Admin

unread,
Jun 24, 2024, 10:54:34 AM (9 days ago) Jun 24
to GAM for Google Workspace

gam redirect csv ./shareddrivefiles.csv user kevin.van***_a@vivald***im.be print filelist select teamdrive 0ANc9JRsF4DaNUk9PVA oneitemperrow filepath fields id,name,basicpermissions,mimetype pmfilter pm deleted false inherited false em

Command: /Users/kevinvangastel/bin/gamadv-xtd3/gam redirect >>>csv ./shareddrivefiles.csv user kevin.***@viva***erim.be print<<< filelist select teamdrive 0ANc9JRsF4DaNUk9PVA oneitemperrow filepath fields "id,name,basicpermissions,mimetype pmfilter pm" deleted false inherited false em


ERROR: Invalid choice (csv ./shareddrivefiles.csv user kevin.van***la@vivaldis***.be print): Expected <csv|stdout|stderr>

Help: Syntax in file /Users/kevinvangastel/bin/gamadv-xtd3/GamCommands.txt

Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki

Ross Scroggs

unread,
Jun 24, 2024, 10:59:29 AM (9 days ago) Jun 24
to google-ap...@googlegroups.com
The spaces in this section "csv ./shareddrivefiles.csv user kevin.van***_a@vivald***im.be" (maybe more) are non-breakable spaces, not regular spaces.
Replace all of the spaces with regular spaces. This often happens when you create the command in an editor that is trying to be helpful, but isn't.

Ross

----
Ross Scroggs



Kevin Van Gastel_Admin

unread,
Jul 1, 2024, 6:13:08 AM (2 days ago) Jul 1
to GAM for Google Workspace
I finally found the mistake. For some reason it doesn't want to take my mailadres with the _a. Once I changed the mailadres to something else without the _a it works. Thanks a lot to the both of you! 
Reply all
Reply to author
Forward
0 new messages