Storage Usage of Shared Drive with Drive ID

1,073 views
Skip to first unread message

曾子顏

unread,
Apr 1, 2022, 7:44:51 AM4/1/22
to Google Apps Script Community
I would like to know if there's is an efficient way to know the storage used by a shared drive in Google Apps Script.

I have noted that Drive.Drives.get(drive_id) (v3) returns tons of properties about shared drive; however, it doesn't provide any information about "Storage Used", which is useful for management.

Clark Lind

unread,
Apr 4, 2022, 3:08:47 PM4/4/22
to Google Apps Script Community
Look under the top (first) item on the Overview. It looks like you can get the  storageQuota there.

曾子顏

unread,
Apr 14, 2022, 9:18:05 AM4/14/22
to Google Apps Script Community
Thanks, but it looks like the storageQuota here refer to storage used by a user instead of a shared drive.

Clark Lind

unread,
Apr 15, 2022, 10:28:21 AM4/15/22
to Google Apps Script Community
My apologies.  You may be able to get what you need by doing a simple Drive.Files.List.  It requires a Drive ID to search, and the response indicates "quotaBytesUsed". 
I hope that helps!
Reply all
Reply to author
Forward
0 new messages