View Shared Drive Subfolder Permissions

162 views
Skip to first unread message

Che Frederick

unread,
Aug 15, 2024, 2:00:59 PM8/15/24
to GAM for Google Workspace
Hey Gang! 

I'm needing to see the subfolder permission structure in effort to lock down some shared drives. 

In short, I've found it's not straight forward. I'm needing to run several commands to generate several reports, then boil it all down. 

So far, here's my process:

1) Generate a list of everything in the target subfolder, this will reveal Doc IDs for the target subfolder contents.

gam user EMAIL ADDRESS print filelist select teamdrive "SHARED DRIVE NAME" teamdrivefilename "FOLDERNAME" fields id,name,modifiedtime todrive

2) Use the list of Doc IDs to individually search for the shared Permission IDs

gam user EMAIL ADDRESS show fileinfo DOCUMENT ID

3)     Convert Permission IDs to primary email

I don't have a GAM command for this step yet - just curious if there is a better way, the reports are quickly getting HUGE, and I'm foreseeing I'll need to create a whole script/macro to complete these steps and collate the report.

Is there an easier way to see the permission structure of shared drives? I could just open the share window for each folder and manually write down the structure, but I'm dealing with hundreds of folders. Any ideas out there my fellow GAM wizards? 

This email and any files transmitted with it are for the use of the intended recipient(s) only. If you have received this email in error, please notify the sender immediately and then delete it. If you are not the intended recipient, you must not keep, use, disclose, copy or distribute this email and any files transmitted with it without the sender's prior written permission. The information contained in this communication is confidential and proprietary information of Beyond Finance, LLC. and its Affiliates. 

Ross Scroggs

unread,
Aug 15, 2024, 2:10:44 PM8/15/24
to google-ap...@googlegroups.com
Send me a Meet/Zoom invitation and I'll help
Ross
----
Ross Scroggs



--
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/e0468429-dcd2-4e87-a611-8797945e02bfn%40googlegroups.com.

Che Frederick

unread,
Aug 20, 2024, 11:52:48 AM8/20/24
to GAM for Google Workspace
Hello again! 

Ross, you're the king. He was kind enough to hop on a call and walk us through some tricks.

Regarding seeing to whom items are shared within a subfolder; we complied the following GAM command

gam redirect csv – todrive user User...@Domain.com print filelist select teamdrive "DriveName" teamdrivefilename "FolderName" fields id,name,modifiedtime,basicpermissions oneitemperrow pm inherited false em pmfilter

Breakdown:
gam redirect csv – todrive user User...@Domain.com - need an account with access to the drive/folder/file
print filelist select teamdrive "DriveName" teamdrivefilename "FolderName" - isolate the drive and folder
fields id,name,modifiedtime,basicpermissions oneitemperrow pm inherited false em pmfilter - selection of ACLs to pull and how to arrange them in sheets.

Result:

Owner - Account used to locate data

id - Document ID of item shared

name - Name of document shared

modifiedTime - time accessed

permission.allowFileDiscovery

permission.deleted

permission.displayName - who viewed it

permission.domain - domain of the viewer

permission.emailAddress - user email address 
permission.id - permission setting
permission.permissionDetails.inherited

permission.permissionDetails.permissionType

permission.permissionDetails.role

permission.role

permission.type

We can now view items that were shared to users not on the original permissions list. This helps my team know which files are not well locked down, and we can now track who viewed the item, when they viewed them, and further refine our file permissions structure. 

Hope someone finds this info helpful. More updates to come! 
Reply all
Reply to author
Forward
0 new messages