domainwidedelegation.comStart free

Use casesDocuments and Drive

Bulk update Drive file owners during a role change

Transfer ownership of Drive files in bulk when a user changes role, using a delegated service account to avoid orphaned or inaccessible documents.

Who it is forIT administrators and automation engineers managing user transitions or departures.
APIsDrive API
Typical scopesdrive

The problem

When a user leaves or changes role, their owned Drive files can become inaccessible or misaligned with team structure. Manual reassignment is slow, error-prone, and often incomplete, leading to loss of important documents or permissions drift.

How it works

  1. Enumerate all files owned by the user using the Drive API and impersonation.
  2. Identify the target account for new ownership, ensuring it is in the same domain.
  3. Update file ownership in batches, respecting API rate limits and Drive ownership transfer requirements.
  4. Handle failures and retries, especially for files shared outside the domain or with special restrictions.

What changes

File ownership is transferred efficiently and consistently, reducing the risk of lost data or broken workflows after a role change.

The trap in this one. Drive API will silently skip ownership transfer for files shared with external users or with pending access requests, returning success but leaving ownership unchanged. You must explicitly check the 'owners' field post-transfer to confirm success, or you will leave a trail of files still tied to the old account without warning.

Watch it explained

Change User Account License on Google Workspace” — Google Workspace Admin on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Can I transfer ownership to a group or shared drive?

No, Drive API only supports ownership transfer to individual users for My Drive files. Shared drives require file migration, not ownership transfer.

How fast do ownership changes propagate?

Ownership changes are usually immediate, but in large batches or under load, Drive may take several minutes to reflect updates in all views.

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

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.