GWS-015 · Script
Drive Ownership Transfer on Offboarding
Transfers a departing user's Google Drive files to a manager or archive account.
What it does
Counts the files the departing user owns, then starts a Google data transfer of all of them (shared and private) to the receiving account. Google places the files in a folder named after the departing user in the receiver's Drive. Optionally includes calendars. Supports one user or a CSV of several. The departing account is not changed in any other way. Preview mode (default) shows the file counts and the transfer that would start.
Requirements
GAM7, installed and authorized by you. GAM is not included. Windows PowerShell 5.1 or PowerShell 7.
How to run it
- Run from: an admin workstation or scheduled task with GAM7 set up
- This is an admin script for your Google Workspace tenant, not a per-device endpoint script
- User interaction: none with app-only sign-in
- Schedule: run on demand, or weekly for reports
Settings
| Name | What it does | Options | Default |
|---|---|---|---|
| Mode | Preview = count and show only (default). Apply = start the transfers. | Preview, Apply | Preview |
| SourceUser | The departing user's email. | ||
| TargetUser | The receiving account's email. | ||
| InputCsv | CSV with columns: SourceUser, TargetUser. | ||
| IncludeCalendar | Also transfer calendars (and release booked rooms on future events). | False | |
| GamPath | Path to GAM. Default: gam (on PATH). | gam |
Exit codes
- 0 = Completed, transfers started (or previewed)
- 1 = Completed, but one or more transfers could not start
- 2 = Script error (see log)
Testing steps
- Run it first with the mode set to Preview on one test account or small group. Nothing is changed in that mode.
- Read the log and confirm the planned changes are what you expect.
- Run your chosen settings on the same test target and confirm the result.
- Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
- Roll out to a small group next, then everyone.
Rollback steps
Preview mode changes nothing. Transfers are not reversed automatically. The new owner can transfer files back.
Version and change log
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | November 2026 | First release. |