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 for | IT admins or analysts tasked with understanding and managing Shared Drive usage at scale. |
|---|---|
| APIs | Drive API, Admin SDK |
| Typical scopes | drive.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
- Enumerate all Shared Drives using the Drive API under delegated access.
- For each Shared Drive, impersonate a user or group member with access to query contents and metadata.
- Aggregate file counts, storage used, and recent activity per drive.
- Correlate drive membership using Admin SDK to attribute drives to teams or departments.
- 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.
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 guideRelated 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.