Re: [GAM] Gam Command to find out all files owned by outside domain user

345 views
Skip to first unread message
Message has been deleted

Ross Scroggs

unread,
Apr 12, 2024, 12:14:57 AM4/12/24
to google-ap...@googlegroups.com
Make sure you are on the current version, 6.72.09

In the commands replace domain.com with your actual domain name.

Files owned by outside users
In these commands the Owner column is the user for whom the command is running, owmers.0.emailAddress in the external owner

Single user: 

gam redirect csv ./ExternallyOwnedFiles.csv user us...@domain.com print filelist showownedby others fields id,name,mimetype,basicpermissions,owners.emailaddress pm type user role owner notdomain domain.com em pmfilter oneitemperrow


All users

gam config auto_batch_min 1 redirect stdout - multiprocess redirect stderr stdout redirect csv ./ExternallyOwnedFiles.csv multiprocess all users print filelist showownedby others fields id,name,mimetype,basicpermissions,owners.emailaddress pm type user role owner notdomain domain.com em pmfilter oneitemperrow


Files owned internally but accessable by outside users

In these commands the Owner column is the internal user that owns the file.

Single user: 

gam redirect csv ./ExternallyAccessedFiles.csv user us...@domain.com print filelist showownedby me fields id,name,mimetype,basicpermissions pm typelist user,group,domain notdomain domain.com em pmfilter oneitemperrow


All users

gam config auto_batch_min 1 redirect stdout - multiprocess redirect stderr stdout redirect csv ./ExternallyAccessedFiles.csv multiprocess all users print filelist showownedby me fields id,name,mimetype,basicpermissions pm typelist user,group,domain notdomain domain.com em pmfilter oneitemperrow


Ross


----
Ross Scroggs



On Apr 11, 2024, at 8:40 PM, 'Linux_01' via GAM for Google Workspace <google-ap...@googlegroups.com> wrote:

Hello Team,

I want to list out all files owned by outside domain user or have the list of files view/comment/edit access to files/folders.

How can we do it?



--
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/f0f4d09f-aed1-4d8c-b22a-42953d3af3bbn%40googlegroups.com.

Gabriele Bartoli (Gabe)

unread,
Apr 25, 2024, 10:58:42 AM4/25/24
to GAM for Google Workspace
Hi Ross,

Am I correct in assuming that the command you listed for "All users" under "Files owned internally but accessible by outside users" will not scan files owned by shared drives?

Cheers,

Ross Scroggs

unread,
Apr 25, 2024, 11:00:38 AM4/25/24
to google-ap...@googlegroups.com

Gabriele Bartoli (Gabe)

unread,
Apr 26, 2024, 10:24:24 AM4/26/24
to GAM for Google Workspace
Thanks for confirming. How would you go about doing the same, but for shared drives?

Essentially, I am looking for a way to make sure that no file owned by us is still shared with specific external users once our collaboration is over.

I don't know if this is in scope for the original request. If you'd prefer having a dedicated thread for this, I can create one.

Cheers,

Ross Scroggs

unread,
Apr 26, 2024, 10:30:15 AM4/26/24
to google-ap...@googlegroups.com

Andrea Barone

unread,
Apr 26, 2024, 10:41:21 AM4/26/24
to google-ap...@googlegroups.com
you can actually configure the setting for public sharing in the admin console itself by OU.

That's a built in option that you should take a look at.

Andrea Barone

Kings County Office of Education
LAN Manager
Office Phone: (559) 589-7090
Cell-phone: (559) 387-6360




KINGS COUNTY OFFICE OF EDUCATION 
E-MAIL CONFIDENTIALITY NOTICE: 

This e-mail communication and any attachments, including documents, files, or previous e-mail messages, constitute electronic communications within the scope of the Electronic Communications Privacy Act, 18 U.S.C. 2510 et seq. This e-mail communication may contain non-public, confidential or legally privileged information intended for the sole use of the designated recipient(s). The unauthorized and intentional interception, use, copy or disclosure of such information, or attempt to do so, is strictly prohibited and may be unlawful under applicable laws. [18 U.S.C. 2511.] If you have received this e-mail in error, please immediately notify the sender by return e-mail and delete the original e-mail from your system.

Gabriele Bartoli (Gabe)

unread,
Apr 26, 2024, 10:47:39 AM4/26/24
to GAM for Google Workspace
> See: https://github.com/taers232c/GAM-Scripts3/blob/master/GetSharedWithListOfUsersTeamDriveACLs.py

Thanks, Ross, I'll have a look.


you can actually configure the setting for public sharing in the admin console itself by OU.

Hi Andrea, maybe I am being dense, but I am not sure which setting you are referring to. Please note that the goal here is not to prevent sharing altogether. I just need to make sure that external partners are "offboarded" properly.

Cheers,
Reply all
Reply to author
Forward
0 new messages