Is there a way to migrate all of a user's files to a department's team drive?

70 views
Skip to first unread message

Chris Rosa

unread,
May 3, 2019, 12:15:13 PM5/3/19
to GAM for G Suite
An employee was let go, and I'd like to move all of their files to the dept. team drive, which can be done manually of course.

Only know discovering that GAM can do quite a bit with Google Drive, but I don't see anything geared towards this specific task.  Or am I overlooking a command?

Thanks!

George Megrelishvili

unread,
Nov 7, 2025, 2:33:15 PM (12 days ago) Nov 7
to GAM for Google Workspace
You need a few specific things to do so:
$employee = email address of employee who left the company
$DriveID = team drive (shared drive ID) where you want to move
$gfolderID = create a folder in the Shared Drive (team drive) where you want to migrate all files and folders
Just run this command, replacing variables with the values if you have, if you don't know how to get values for the Shared Drive or the Shared folder, ask in reply or ask Google :-)
  • gam user "$employee" copy drivefile root teamdriveparentid "$DriveID" newfilename "$gfolderID" recursive
This command will migrate data with sharing linkage, so all who had access to the files folder will be moved to the shared drive (team drive) also and be able to access from there.
Reply all
Reply to author
Forward
0 new messages