i should think you could ask whether to useDomainAdminAccess after you ask whether to configure as a team drive but before listing the drives, and then add the permissions if necessary once the team drive has been selected. you don’t need to worry about creating an unnecessary permission because the api declines to duplicate permissions silently.
with gsuite, i think you’re either an admin or your not, so all the team drives in the domain are listable to admins.
you can add permissions to a team drive for a user or a group, either of which needs to be specified with an email address.
i run this script as an external backup of my org’s admin docs and team drives, so i like to leave things as i found them after the backup session is over. i don’t think that would be practical with rclone, since it doesn’t really need the principal of a per-session config.
i’m glad you think so. thanks for the brilliant code. i’ve been waiting for this for a long time.
edit: i just realized i was being unnecessarily obtuse. useDomainAdminAccess does not refer to being an admin of individual team drives, but rather to admins of the entire gsuite domain. gsuite admins have access to all team drives, and thus team drives (in your domain) of which you are a member will always be a subset of the list returned using useDomainAdminAccess.