Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
340 views
in Technique[技术] by (71.8m points)

google apps script - Is there a way to create a folder tree of all Shared Drives as an admin?

Google Drive is quite impressive for a web app, but it seems to be optimised for search, not spatial navigation so it's painfully slow for myself and colleagues trying to navigate, especially if we don't know exactly which file or folder we're looking for.

To help them out, I would like to create a "site map" of each Shared Drive, basically just a tree view so they can see the overall folder structure and jump straight to a specific folder, even if it's 5 or 6 folders deep.

I have a working proof of concept that I was thinking I could run daily/nightly but it falls down on Shared drives that I don't have access to. I can list the drives as an admin, using Drive.Drives.list({useDomainAdminAccess: true}).items;, but I can't list the contents.

Is there a way to do the equivalent of useDomainAdminAccess: true on Drive.Files.list? Is there another workaround? I'm wondering if I need to first check if I have access to the drive... if I don't I could then:

  • give myself view access to the Shared Drive
  • create the file list
  • remove my access again

I think it would work, it just feels like an ugly hack so I'm wondering if there's a better approach?

question from:https://stackoverflow.com/questions/66056744/is-there-a-way-to-create-a-folder-tree-of-all-shared-drives-as-an-admin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...