Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 1.11 KB

README.md

File metadata and controls

23 lines (15 loc) · 1.11 KB

google-drive-audit-shared

So there I was, not wanting to pay for G Suite Business or Enterprise, knowing zero Python, but hoping I could audit my shared files and find what had been shared outside my company.

Starting with @jameswthorne's blog post and script, I hacked around with the google drive API for far too long, and added a helper class found on @hayify's blog to do make life easier and added a pretty print for all the JSON things. And here we are today.


Parsing through the output can be fairly easily made into a usable list by:

sed -i "s/owners': \[{'emailAddress/OwnersEmailAddress/g" filename_1
egrep -v "'emailAddress': '([[:alnum:]_.-][email protected])'" filename_1 | grep -B 2 "'emailAddress'" > filename_2

@jameswthorne's original post that got me here: Find All Shared Files in Google Drive with a Python Script.

@hayify's helper class: Handling complex nested dicts in Python