# Get list of students in OU
gam redirect csv ./MSStudents.csv ou /MSStudents print users fields primaryemail
# redirect csv ./MSStudents.csv ou /MSStudents - List of student email addresses, replace with actual OU name
# print users fields primaryemail
# Get the top items in all Middle School student's My Drives
gam config num_threads 20 redirect csv ./MSStudentsTopItems.csv multiprocess redirect stdout - multiprocess redirect stderr stdout csv ./MSStudents.csv gam user "~primaryEmail" print filelist my_top_items fields id,name
# config num_threads 20 - Speed up processing
# redirect csv ./MSStudentsTopItems.csv multiprocess - List of top level files/folders
# redirect stdout - multiprocess redirect stderr stdout - Clean progress messages
# gam user "~primaryEmail" print filelist my_top_items fields id,name - Get ids of files/folders directly in My Drive
# Create a folder to hold these items
gam config num_threads 20 redirect stdout ./MakeMSStudentsNewFolder.txt multiprocess redirect stderr stdout csv ./MSStudents.csv gam user "~primaryEmail" create drivefile mimetype gfolder drivefilename "MSFiles" parentid root
# config auto_batch_min 1 num_threads 20 - Speed up processing
# redirect stdout ./MakeMSStudentsNewFolder.txt multiprocess redirect stderr stdout - Log folder creation
# gam user "~primaryEmail" create drivefile mimetype gfolder drivefilename "MSFiles" parentid root - Create new top level folder, name as desired
# Move the top items into the new folder
gam config num_threads 20 redirect stdout ./MoveMSStudentsTopItemsToNewFolder.txt multiprocess redirect stderr stdout csv ./MSStudentsTopItems.csv gam user "~Owner" update drivefile "~id" parentname "MSFiles"
# Config num_threads 20 - Speed up processing
# redirect stdout ./MoveMSStudentsTopItemsToNewFolder.txt multiprocess redirect stderr stdout - Log moving top level items into new folder
# csv ./MSStudentsTopItems.csv - File created in first step
# gam user "~Owner" update drivefile "~id" parentname "MSFiles" - Move top level items into new folder, name as desired
You can test by making a MSStudents.csv file with header primaryEmail and one or two rows of email addresses
--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAGSDd_nd6v4RybEtHy8TLkm9iCJid-g_hFRDptcJzuvymvycpQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/679AFC5A-D55E-41E6-A2BC-CEEC06A85620%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/CAGSDd_ma19uKOMCRfQjbOTTjgvyM%3DVLapHftYmPnJ8RNdSg1BA%40mail.gmail.com.