These code samples show how you can use Google Apps Script to manage and search through the content of shared drives in Google Drive using the Drive API.
Some handy Google Apps Script snippets from Amit Agarwal for interacting with Shared Drives. The post includes solutions for:
- Create a Shared Drive
- Share a Shared Drive with a User
- List all Shared Drives
- List Files in a Shared Drive
- Move Files in Shared Drives
- Copy Files in Shared Drives
Source: Manage Shared Drives in Google Drive with Google Apps Script – Digital Inspiration
Member of Google Developers Experts Program for Google Workspace (Google Apps Script) and interested in supporting Google Workspace Devs.