domainwidedelegation.comStart free

Use cases → Documents and Drive

Automatically remove ex-employees from Shared Drives

Use delegated automation to ensure former staff are promptly and reliably removed from all Shared Drives they could access.

Who it is forIT and security teams managing offboarding in Google Workspace.
APIsDrive API, Admin SDK
Typical scopesdrive, admin.directory.user.readonly

The problem

Manual removal from Shared Drives is slow and inconsistent, especially when users belong to dozens of drives. Former staff can retain access for days or weeks, risking data leaks.

How it works

  1. Detect departures by monitoring user status via Admin SDK.
  2. List all Shared Drives and their memberships using the Drive API.
  3. For each departed user, remove them from every Shared Drive they appear in.
  4. Log actions and notify admins of any failures for follow-up.

What changes

Departed users are consistently stripped of Shared Drive access within minutes, reducing the attack surface and audit burden.

The trap in this one. If you try to remove a user who is the last Manager of a Shared Drive, the Drive API will silently fail and leave them in place—no error, no event. You must check for remaining Managers before removal and assign a new one if needed, or the automation gives a false sense of security.

Watch it explained

“How to use Gemini with Google Workspace - Quick Tutorial” — Simpletivity with Scott Friesen on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

What happens to the user's files in Shared Drives?

Files in Shared Drives are owned by the drive, not the user, so nothing is deleted. Only membership and access are affected.

Does this work for suspended users?

Yes, as long as the user object still exists, you can remove them from Shared Drives. Deletion or suspension does not automatically strip drive memberships.

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 guide

Related use cases

Reassign Drive permissions in bulk with delegation

Use a delegated service account to change or transfer Drive file permissions at scale, for user transitions or access audits.

Bulk remove external sharing from Drive files

Audit and revoke third-party access to Drive files in bulk using a service account, to close off lingering external shares after projects or audits.

Audit cross-domain file sharing in Google Drive

Detect and report files shared outside the organisation using delegated access, so admins can act before data leaks escalate.