r/gsuite•
ogie666

GAM to find files owned by people outside our domain

Trying to move over some folders from My Drive to Shared drives. Been burnt by files owned by external not copying over in the past. I know there are a lot of files and folders owned by people outside our domain in there. So was looking to hopefully use GAM to find and make copy of files in one folder, that are owned by anyone outside our domain. So far I have not been able to figure this out. I even dumped a list of all users files to csv and it didn't contain any items owned by external. Any help would be greatly appreciated.

Posted Apr 20, 2021, 6:20 PM UTC

73
hjkimbrianGoogle Partner•

When you do gam print filelist you have to add showownedby any or showownedby other or others.

Note this will slow down the GAM command significantly as to the users may not always have permissions to call API to find owner of an externally owned file and eventually run into rate limiting and exponential backoff.

3
ogie666OP•

Thank you! Your post pointed me in the right direction. First up was I should be using GAM Advanced and not the vanilla GAM. Once I got that setup I was able to run print filelist with showownedby any, and it gave me the info I was looking for. Thanks again you saved me a lot of headaches.

2
Gabriel-GAM•

To list all shared files outside the domain enter the following GAM command:

"gam all users print filelist id title permissions > filelistperms.csv“
"python GetSharedFiles.py filelistperms.csv sharedfiles.csv”
"sharedfiles.csv”

We have written a GAM guide explaining this which you can download here

Best of luck,

Gabriel from Tricent

3
[deleted]•

[deleted]

1