how to bulk upload profile picture of user by admin google

1,065 views
Skip to first unread message

Trần Thông

unread,
Apr 12, 2023, 11:57:56 PM4/12/23
to GAM for Google Workspace
can u send me link post or video about that???

Ross Scroggs

unread,
Apr 13, 2023, 10:33:48 AM4/13/23
to google-ap...@googlegroups.com
Make a CSV file UserPhotos.csv with two columns: primaryEmail,photofile
primaryEmail,photofile

gam csv UserPhotos.csv gam user "~primaryEmail" update photo "~photofile"

If multiple users have the same photo, use the same filename on their rows.

Ross
----
Ross Scroggs



On Apr 12, 2023, at 8:20 PM, Trần Thông <thon...@gmail.com> wrote:

can u send me link post or video about that???

--
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/29918788-e7f5-462e-8aa3-5668dff6c28an%40googlegroups.com.

Trần Thông

unread,
Apr 13, 2023, 11:17:44 PM4/13/23
to google-ap...@googlegroups.com
I tried it yesterday, it worked but no pictures were uploaded

Vào Th 5, 13 thg 4, 2023 vào lúc 21:33 Ross Scroggs <ross.s...@gmail.com> đã viết:

Trần Thông

unread,
Apr 14, 2023, 1:35:01 AM4/14/23
to GAM for Google Workspace
when i run code gam csv <path to CSV file> gam user "~email" update photo "~filename"   (i replace with my file csv path)
it's bulk show

Select the authorized scopes by entering a number.
Append an 'r' to grant read-only access or an 'a' to grant action-only access.

[*]  0) Chrome Browser Cloud Management (supports readonly)
[*]  1) Chrome Management API - read only (2 scopes)
[*]  2) Chrome Policy API
[*]  3) Classroom API - counts as 5 scopes
[*]  4) Cloud Identity - Groups (supports readonly)
[*]  5) Cloud Identity - Inbound SSO Settings (supports readonly)
[*]  6) Cloud Identity - OrgUnits (supports readonly)
[*]  7) Cloud Identity - User Invitations (supports readonly)
[*]  8) Contact Delegation (supports readonly)
[*]  9) Data Transfer API (supports readonly)
[*] 10) Directory API - Chrome OS Devices (supports readonly)
[*] 11) Directory API - Customers (supports readonly)
[*] 12) Directory API - Domains (supports readonly)
[*] 13) Directory API - Groups (supports readonly)
[*] 14) Directory API - Mobile Devices (supports readonly and action)
[*] 15) Directory API - Printers (supports readonly)
[*] 16) Directory API - Organizational Units (supports readonly)
[*] 17) Directory API - Resource Calendars (supports readonly)
[*] 18) Directory API - Roles (supports readonly)
[*] 19) Directory API - User Schemas (supports readonly)
[*] 20) Directory API - User Security
[*] 21) Directory API - Users (supports readonly)
[*] 22) Group Settings API
[*] 23) License Manager API
[ ] 24) Pub / Sub API
[*] 25) Reports API - Audit Reports
[*] 26) Reports API - Usage Reports
[ ] 27) Reseller API
[*] 28) Site Verification API
[*] 29) Vault Matters and Holds API (supports readonly)
[ ] 30) Cloud Storage - Vault/Takeout Download/Copy (supports readonly)
[*] 31) User Profile (Email address - read only) [required]

     s)  Select all scopes
     u)  Unselect all scopes
     e)  Exit without changes
     c)  Continue to authorization

Please enter 0-31[r|a] or s|u|e|c:

and don't upload any photo. 
what i do next??

Vào lúc 10:17:44 UTC+7 ngày Thứ Sáu, 14 tháng 4, 2023, Trần Thông đã viết:

Aizad Dx

unread,
Mar 1, 2024, 9:26:07 AM3/1/24
to GAM for Google Workspace
Not sure if this answer is still useful but here you will need to authorize scopes.

press "s" ENTER and then press "c" and ENTER to continue to authorization

Rick Davis GLSD

unread,
Mar 12, 2024, 1:30:33 PM3/12/24
to GAM for Google Workspace
Hey Ross,

When using this CSV and command can or do I need to use the URL or drive_link for the photofile name if the files are in a shared drive?

Rick 

Rick Davis GLSD

unread,
Mar 12, 2024, 3:33:25 PM3/12/24
to GAM for Google Workspace
I was able to download the photos to my desktop and then modified the spreadsheet to use the local file path.

I used this command:

gam csv StudentPhotos.csv gam user "~StudentEmail" update photo "~File"

Successfully updated 2057 out of 2443 users. 

I saw two errors:
  • The first one is self explanatory and accurate (316).
    • [Errno 2] No such file or directory
  • The second one (70), I’m not sure about
    •  Service not applicable/Does not exist

Rick Davis GLSD

unread,
Mar 12, 2024, 3:38:20 PM3/12/24
to GAM for Google Workspace
I saw newer commands for this using gphoto at https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Photo#upload-a-users-photo-specifying-a-google-drive-owner-and-file-name

But without a real world sample or lower level step by step guide I struggle to put the correct command together. :face_with_spiral_eyes:

Ross Scroggs

unread,
Mar 12, 2024, 6:34:30 PM3/12/24
to google-ap...@googlegroups.com
  • The second one (70), I’m not sure about
    •  Service not applicable/Does not exist
  • This indicates a bad email address or valid addresses in restrictive O
Do: gam info user x...@dmoain.com

Do: gam user x...@domain.com check serviceaccount

Ross



--

Rick Davis GLSD

unread,
Mar 13, 2024, 12:44:22 PM3/13/24
to GAM for Google Workspace
Thank you sir. Once again you are spot on. The 70 users are either PreK students whose graduating class year (which we use in the email address for easier sorting, etc) has changed do to them being held back or moved to Kindergarten. The others are K-12 students with similar situations. Therefore their email addresses are off by one digit.

Rick Davis GLSD

unread,
Mar 15, 2024, 8:22:03 AM3/15/24
to GAM for Google Workspace
What is the difference between photo and profilephoto?

Now that I have a photo uploaded to all users in the list that was given to me and I notice that the list is incomplete when comparing it to all the users in the OU's. Is there a command that could list all users in an OU that DO NOT have a photo?

My results:

User DOES NOT have a photo uploaded:

If I run "gam user <emailaddress> get profilephoto"
A jpg with a color circle with the users initial is downloaded.

If I run "gam user <emailaddress> get photo"
I get Photo Download Failed: Does not exist.

User a has uploaded photo both commands download the same previously uploaded jpg.

Reply all
Reply to author
Forward
0 new messages