DEV Community

Terry Djony
Terry Djony

Posted on

Auditing All Shared Files in Google Drive with Apps Script

I needed a way to list who can access every shared file on my Google Drive. However, most scripts I found online were not working for me.

So I opened Cursor and started building it myself. At first, I intended to publish the Apps Script as an add-on, but it turns out the script needs a restricted scope thus requiring a long review process.

Finally I decided to publish the script for free, along with a Google Sheets Template.

How to Audit Files on Google Drive

This is how you can list who has access to every shared file on your Google Drive:

  1. Copy the template (includes the script): Drive Audit Files Template.

    copy document

  2. Open your copy and use the Drive Audit menu (as shown):

google drive audit files script

  • Click Run Audit Now to start your first scan.
  • If Authorization Required appears, click OK and proceed. authorization
  • Click Advanced (bottom-left), then Go to Clasp Drive Audit Add-on Verification pops up
  • Click Select all to grant the requested permissions, then Continue. Select all

You’ll see the audit begin:
starting audit

The script will add Drive Audit and Audit Status sheets to your file.

  • Review details in Drive Audit (sensitive info in the screenshot is redacted):
    drive audit

  • Check progress/completion in Audit Status (e.g., running vs. done).

You can check the full source code on my github.
I also posted this on my blog

Top comments (0)