Print files,Docs or anything shared externally and exclude my domain

193 views
Skip to first unread message

Bassel Massamiri

unread,
Dec 19, 2022, 10:06:10 AM12/19/22
to GAM for Google Workspace
Hello Everyone ,

I know that there is a script to do that :


The problem with this script is when i run the below command it takes so much time and i lose connection to my Cloud shell session :
gam all users print filelist id title permissions owners mimetype > filelistperms.csv

Is there any command to exclude files or docs are shared internally with mydomain.com ?

Thanks Everyone,

Ross Scroggs

unread,
Dec 19, 2022, 10:28:18 AM12/19/22
to google-ap...@googlegroups.com
If you are running Advanced GAM, the script documentation shows how to filter the list of files.
However, GAM has to do most of the filtering as the Drive API doesn't, so the command can still take a long time.

#  $ Advanced GAM: You can have GAM do some pre-filtering                                                                                                                                                                                              
#  $ EXCLUSIVE_DOMAINS = True: You're interested only in domains not in DOMAIN_LIST which would typically be your internal domains                                                                                                                     
#    Add the following clause to the command for each domain in DOMAIN_LIST: pm not domain domainx.com em                                                                                                                                              
#  $ EXCLUSIVE_DOMAINS = False: You're interested only in domains in DOMAIN_LIST which would typically be external domains                                                                                                                             
#    Add the following clause to the command for each domain in DOMAIN_LIST: pm domain domainx.com em                                                                                                                                                  
#  $ INCLUDE_ANYONE = True                                                                                                                                                                                                                             
#    Add the following clause to the command: pm type anyone em                                                                                                                                                                                        
#  $ gam config auto_batch_min 1 redirect csv ./filelistperms.csv multiprocess all users print filelist fields id,name,permissions,owners.emailaddress,mimetype <pm clauses>                                                                           

gam config auto_batch_min 1 redirect csv ./filelistperms.csv multiprocess all users print filelist fields id,name,permissions,owners.emailaddress,mimetype pm not domain mydomain.com em 

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/4069eb67-e0a7-4f9e-b4c3-1cab3dce9af4n%40googlegroups.com.

Bassel Massamiri

unread,
Dec 19, 2022, 11:00:18 AM12/19/22
to google-ap...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages