Reset "root_folder_id" command for domain-wide delegation?

My situation is - I have thousands of users with home drives on our network that I'm trying to copy over to their Google Drives. I have a batch file that will read their google drive email addresses from a TXT file list, create a folder, copy their network drive to it, then shoot them an email with GAM when it's done. It works fine - for the person - then it errors out on every person after that. After digging around, it looks like it sets the "root_folder_id" the first time I run the command on a user.

I'm using Google's domain-wide delegation as a super admin, so I'm using this one account to upload files directly to every user. The problem is that the root_folder_id gets set after it runs the command for a specific user - and I need to either find a command that resets that, or an alternative way to accomplish this.

Any ideas?

For reference, here is my batch file that works just fine:

setlocal EnableExtensions DisableDelayedExpansion
for /F "tokens=1,2 delims=," %%a in (testdata.txt) do (
    rclone -v --drive-impersonate %%b mkdir GSUITE:TEST12345
	PING localhost -n 10 >NUL
    rclone -v --drive-impersonate %%b copy Y:\%%a GSUITE:TEST12345
	PING localhost -n 5 >NUL
	gam sendemail %%b from hdrive@test.org subject "H Drive Migration - Complete" message "Your H Drive migration has been completed. Please look for a folder called '!HDRIVE' containing your {A0} folder and "H" drive files." html true replace A0 %%b
)

endlocal

That is correct. It is helpful for rclone to have knowledge of the "root_folder_id" but it interferes with --drive-impersonate.

I think the right fix might be for --drive-impersonate to ignore root_folder_id - what do you think?

Anyway it is an easy fix for your script, just add --drive-root-folder-id "" to your command line and it should work.

that works! thank you!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.