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