Renaming Google Classroom Folder using GAM

309 views
Skip to first unread message

Elsa LAI

unread,
Sep 1, 2021, 10:48:58 PM9/1/21
to GAM for Google Workspace
Hi all,

As I know that once the Classroom Name has been reset, the corresponding Classroom Folder Name will not be changed accordingly.  Teachers may find it confusing when managing different school years' folders.

Is it possible to rename a batch of Classroom Folders during school year transition using GAM (based on the teacherFolder.id)?  I got an error while running the following Google Apps Script:

function myFunction() 
{
  var folder = DriveApp.getFolderById('xxxxxxxxxxxxxxxxxxxx').setName('yyyyyyyyyyy')
}

Error 
Exception: No item with the given ID could be found. Possibly because you have not edited this item or you do not have permission to access it.
myFunction   @ Code.gs:3

Thanks for your support!

Elsa

Ross Scroggs

unread,
Sep 1, 2021, 11:11:07 PM9/1/21
to google-ap...@googlegroups.com
Elsa,

You can rename the Classroom Folder but you must be acting as the owner/teacher.

Sample:

$ gam print courses teacher us...@domain.com >courses.csv

Add a new column, NewName, to tscourses.csv

$ gam csv courses.csv gam user "~ownerId" update drivefile "~teacherFolder.id" newfilename "~NewName"



Ross



Disclaimer: This email (and any attachments) may contain privileged and confidential information and is solely for the use of the intended recipient(s). Any unauthorized dissemination, distribution or copying of this email is strictly prohibited. If you have received this email by mistake, please notify the sender immediately and delete this email.

--
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/886a78f6-c037-4009-ac7a-5957b2a85270n%40googlegroups.com.


--

黎歷宜LAI Lik Yee, Elsa

unread,
Sep 2, 2021, 3:50:09 AM9/2/21
to google-ap...@googlegroups.com
Ross,

I got what you mean.  Thank you so much!!! ^_^

Elsa


You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/FpVevPG5QQk/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAJkvRS-vQXBzH%2BKYTHtOJdtU%2BYYx4pxCt%2BUNmaSO-OOONO3q%3DQ%40mail.gmail.com.

Federico Finati

unread,
Oct 6, 2021, 4:59:58 AM10/6/21
to GAM for Google Workspace
Hi, the command
gam user xxxxxxxx update drivefile 0B1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxFU newfilename "New Folder"
does not work.

user xxxxx is an ownerid and  0B1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxFU is the teacherFolder.id

but give the error 0B1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxFU is not a valid argument for "gam <users> update drivefile"
 
Maybe it depends on the security updates of version 6.07 or am I doing something wrong?
Thanks.

Ross Scroggs

unread,
Oct 6, 2021, 9:18:59 AM10/6/21
to google-ap...@googlegroups.com
Federico,

You have to include id before the <DriveFileID>
gam <UserTypeEntity> update drivefile (id <DriveFileID)|(drivefilename <DriveFileName>)|(query <QueryDriveFile) [copy] [newfilename <DriveFileName>] <DriveFileUpdateAttribute>*


gam user xxxxxxxx update drivefile id 0B1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxFU newfilename "New Folder"

Ross
Message has been deleted

Federico Finati

unread,
Oct 7, 2021, 12:43:40 AM10/7/21
to GAM for Google Workspace

Thanks for your help!!!

gam user ...@..... update drivefile id 1cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxqi newfilename "New Folder"

Work fine!!!

You must also replace the ownerId with the email.
Reply all
Reply to author
Forward
0 new messages