domainwidedelegation.comStart free

Use cases β†’ Reporting and data

Generate usage reports for Shared Drives via API

Automate reporting on file counts, storage, and activity within Shared Drives to satisfy audit, billing, or capacity planning requirements.

Who it is forIT admins or analysts tasked with understanding and managing Shared Drive usage at scale.
APIsDrive API, Admin SDK
Typical scopesdrive.readonly, admin.directory.group.readonly

The problem

Manual Shared Drive reporting is slow, incomplete, and inconsistent, especially when drives are owned by groups or span large organisations. Without automation, it’s nearly impossible to keep up with growth, spot misuse, or allocate costs accurately.

How it works

  1. Enumerate all Shared Drives using the Drive API under delegated access.
  2. For each Shared Drive, impersonate a user or group member with access to query contents and metadata.
  3. Aggregate file counts, storage used, and recent activity per drive.
  4. Correlate drive membership using Admin SDK to attribute drives to teams or departments.
  5. Export results for review or integration with billing systems.

What changes

Admins receive accurate, up-to-date usage data for every Shared Drive, supporting audits and internal chargebacks without manual effort.

The trap in this one. Drive API silently omits Shared Drives if the impersonated user lacks at least Viewer on each drive. Drives owned exclusively by groups or orphaned by user departures will not appear, producing incomplete reports with no explicit error. You must ensure the service account is granted membership on all Shared Drives or impersonate a user who is, or the API's results will be misleading.

Watch it explained

β€œHow to use Google Drive API to upload, delete and create a public URL for a file. πŸ”₯” β€” Mafia Codes on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.

Questions people ask

Can I use a service account directly to list Shared Drive contents?

No, the service account must impersonate a user who is a member of the drive. Service accounts themselves do not appear as members unless explicitly added.

How often do Shared Drive membership changes propagate?

Membership changes can take several minutes to propagate, so adding the service account or user for reporting purposes is not instant. Schedule reporting jobs with this delay in mind.

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

Monitor total Drive storage usage across the organisation

Track and report aggregate Drive usage per user and group, so you see quota risks before they hit.

Report Google Drive usage across the whole organisation

Pull storage and activity data for every user’s Drive to audit quotas, flag outliers, or feed billing models.

Report Drive storage usage per organisational unit

Aggregate and report Google Drive storage usage for each organisational unit using a delegated service account with Admin SDK access.