Use cases → Documents and Drive
Remove external access from shared Drive files in bulk
Strip links and revoke external collaborators from hundreds or thousands of shared Drive files using delegated access.
| Who it is for | IT teams responsible for data security across shared Drives and user My Drives. |
|---|---|
| APIs | Drive API |
| Typical scopes | drive |
The problem
External sharing on Drive files accumulates over time, especially when users self-serve. Manual audits are slow and miss files, leaving sensitive data exposed.
How it works
- List files with external permissions using the Drive API and a delegated service account.
- For each file, enumerate and record all non-domain permissions.
- Remove any external users, groups or link-sharing permissions.
- Log each change for audit and possible rollback.
What changes
External access is comprehensively revoked at scale, reducing the attack surface and cleaning up legacy shares.
Watch it explained
“Bulk Share Google Drive Files Access using Google Apps Script | Aryan Irani” — Aryan Irani on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.
Questions people ask
Can this process handle shared Drives and user My Drives?
Yes, but shared Drives have stricter permission models and may require additional API fields and checks. Always test on both types before running at scale.
What about files owned by suspended or departed users?
A super-admin delegated service account can still act on these files, but transfer of ownership may be needed for full cleanup.
Want this built?
This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.
Talk to us Or read the setup guideRelated use cases
Create a client folder structure the moment a deal closes
Provision a consistent Drive folder tree, seeded with templates and shared with the right people, automatically.
Generate documents from a template and real data
Produce agreements, letters and reports from a Docs template with fields filled from your systems.
Sort incoming files into the right place automatically
Watch a drop folder, work out what each file is, and file it where it belongs with a consistent name.