audit_external_permissions
Identifies files shared with users outside your domain, enabling permission re-evaluation before migrating to Shared Drives with different sharing policies.
Instructions
Step 7 — Files shared with users outside your organisation.
Flags files that have at least one permission entry for a user NOT
in the specified domain. These may require cleanup or
re-evaluation before migrating to a Shared Drive with different
sharing policies.
Args:
user_email: The email of the user who owns the source folder.
folder_id: The ID of the source folder.
sheet_id: The ID of the Google Sheet for output.
domain: Your organisation's domain (e.g. "company.com").
sheet_name: The tab name (default: "external_owner").
GAM command:
gam user <user_email> print filelist select <folder_id>
fields "id,name,mimeType,basicpermissions,owners"
filepath excludetrashed
permissionmatch type user notdomainlist <domain> endmatch
pmfilter oneitemperrow
todrive tdfileid <sheet_id> tdsheet "<sheet_name>"
tdupdatesheet tdretaintitle
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain | Yes | ||
| sheet_id | Yes | ||
| folder_id | Yes | ||
| sheet_name | No | external_owner | |
| user_email | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |