Get List of All GDrive Files and Folder Shared with a User

6,987 views
Skip to first unread message

Michael Pruhs

unread,
Feb 13, 2018, 11:50:39 AM2/13/18
to GAM for G Suite
I am working on revoking permissions to GDrive files for user accounts after an employee exits. I'm able to transfer ownership of files that the user owns either using "gam user old...@xyz.org transfer drive super...@xyz.org" or by generating a file list into a CSV and using a bulk operation to transfer their data over. However, when generating a filelist it only shows files that the user owns, not files that are shared with the user. 

We cut off user access to the account after they leave, but we would also like to remove the user from all files that have been shared with them, to make sure we have a cleaner exit, as well as to not cause confusion for individuals who have access to the file(s) and see that they are still shared with the user. We have not been able to find a way to generate a file list that specifically shows only files shared with this user that includes the File ID and Owner. Our hope would be to take this list and use it in another bulk operation to remove the shared permissions with the exiting user. 

Any Suggestions? 

Graham Ingleby

unread,
Feb 13, 2018, 12:19:10 PM2/13/18
to GAM group
Are you using a command like gam user us...@domain.com showfilelist? If so then from https://github.com/jay0lee/GAM/wiki/GoogleDriveManagement#managing-google-drive-files-and-folders-for-users, would fullquery help? 
" The optional fullqueryargument is similar to query but omits the "'me' in owners" portion of the query "
I guess you would need a query, but you could use something like createddate<tomorrow

 


Graham Ingleby  |  Google Cloud Consultant  |  +44 1344 203395  |  ging...@ancoris.com
             
Twitter Google+ LinkedIn YouTube Ancoris 

Subscribe to our blog and receive our latest articles straight to your inbox

Ancoris receives Computing Cloud Excellence Award

Powered by Ancoris Signatures


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/08025c01-a525-466f-af7a-634f5ee66734%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




Ross Scroggs

unread,
Feb 13, 2018, 12:24:07 PM2/13/18
to google-ap...@googlegroups.com
Michael,

gam user us...@domain.com print filelist fullquery "sharedWithMe=True" id title owners permissions > userfiles.csv

Ignore the Owner column, it should really be called User. The actual owner is in owners.0.emailAddress


Ross


--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/08025c01-a525-466f-af7a-634f5ee66734%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Michael Pruhs

unread,
Feb 13, 2018, 1:04:47 PM2/13/18
to google-ap...@googlegroups.com
Ross,

Thank you! That should work for what we need. I did find, after following Graham's suggestion this page https://github.com/taers232c/GAMADV-X/wiki/Users---Drive---Files#display-file-lists   that it looks like you wrote Ross. I was curious if the command here might work as well.  Would "gam user old...@xyz.org show filelist showownedby others" work to generate a similar list? I have tried running this but it seems I am missing something.

On Tue, Feb 13, 2018 at 9:23 AM, Ross Scroggs <ross.s...@gmail.com> wrote:
Michael,

gam user us...@domain.com print filelist fullquery "sharedWithMe=True" id title owners permissions > userfiles.csv

Ignore the Owner column, it should really be called User. The actual owner is in owners.0.emailAddress


Ross

On Tue, Feb 13, 2018 at 8:47 AM, Michael Pruhs <michae...@cui.edu> wrote:
I am working on revoking permissions to GDrive files for user accounts after an employee exits. I'm able to transfer ownership of files that the user owns either using "gam user old...@xyz.org transfer drive super...@xyz.org" or by generating a file list into a CSV and using a bulk operation to transfer their data over. However, when generating a filelist it only shows files that the user owns, not files that are shared with the user. 

We cut off user access to the account after they leave, but we would also like to remove the user from all files that have been shared with them, to make sure we have a cleaner exit, as well as to not cause confusion for individuals who have access to the file(s) and see that they are still shared with the user. We have not been able to find a way to generate a file list that specifically shows only files shared with this user that includes the File ID and Owner. Our hope would be to take this list and use it in another bulk operation to remove the shared permissions with the exiting user. 

Any Suggestions? 

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.



--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--
God Bless,

Mike Pruhs
Client Services Manager
Concordia ITS

Ross Scroggs

unread,
Feb 13, 2018, 1:08:40 PM2/13/18
to google-ap...@googlegroups.com
Mike,

What Graham pointed you to is my Advanced GAM (https://github.com/taers232c/GAMADV-X)
Those commands will not work in standard Gam.

Ross




--
God Bless,

Mike Pruhs
Client Services Manager
Concordia ITS

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages