Change display names programatically from CSV

28 views
Skip to first unread message

I. Wilson IV

unread,
Nov 27, 2025, 3:31:32 PM (2 days ago) Nov 27
to GAM for Google Workspace
Greetings. I have a CSV of names with the fields NameFirst, NameLast, NameMiddle, Rank, EmailAddress.  I need to change the display name for each of those to this specific format:

NameLast, NameFirst NameMiddle Rank

The closest I've gotten is using 
gam csv justme.csv gam update user ~MasterEmailAddress displayname '~NameLast', '~NameFirst' '~NameMiddle' '~Rank'

but I get the following error:

Command: /home/admin/bin/gam7/gam csv users.csv gam update user ~EmailAddress displayname >>>"~NameLast,"<<< ~NameFirst ~NameMiddle ~Rank

ERROR: Header "NameLast," not found in CSV headers of ",NameLast,NameFirst,NameMiddle,Rank,EmailAddress".
Help: Syntax in file /home/admin/bin/gam7/GamCommands.txt
Help: Documentation is at https://github.com/GAM-team/GAM/wiki

I do see that it's getting hung up on the comma, including it as part of the field despite my desires. I don't see anything in the documentation that specifically addresses this, though. Here's hoping you can assist.  Thanks.

—Isaac

Ross Scroggs

unread,
Nov 27, 2025, 3:38:00 PM (2 days ago) Nov 27
to google-ap...@googlegroups.com
gam csv justme.csv gam update user "~EmailAddress" displayname "~~NameLast~~, ~~NameFirst~~ ~~NameMiddle~~ ~~Rank~~"

This: ERROR: Header "NameLast," not found in CSV headers of ",NameLast,NameFirst,NameMiddle,Rank,EmailAddress".
indicates a problem with you CSV file headers; what's the comma in front of NameLast.

Send me a private Meet/Zoom invitation and I'll hep.

Ross
----
Ross Scroggs



--
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 visit https://groups.google.com/d/msgid/google-apps-manager/45d61a81-d0c7-4988-a104-73ba8bd39068n%40googlegroups.com.

Ross Scroggs

unread,
Nov 27, 2025, 3:47:30 PM (2 days ago) Nov 27
to google-ap...@googlegroups.com
Look at the header row in your CSV file, is there a comma before NameLast?

Ross
----
Ross Scroggs


I. Wilson IV

unread,
Nov 28, 2025, 1:08:31 PM (23 hours ago) Nov 28
to GAM for Google Workspace
None that shouldn't be present in a CSV, but your suggestion of the ~~field~~ seems to have worked.

The only problem now is that it doesn't seem to work for external contacts. I used your ExchangeDomainSharedContacts.py script to swap contacts from domain A to domain B successfully, but when I try to change the display name of contacts from domain B, I get:

User: user...@domainb.com, Update Failed: Not Authorized to access this resource/api

Do you happen to know which scope I need to enable for this to work?

Thanks again.

Ross Scroggs

unread,
Nov 28, 2025, 1:12:04 PM (23 hours ago) Nov 28
to google-ap...@googlegroups.com
Send me a private Meet/Zoom invitation and I'll help.

Ross
----
Ross Scroggs


I. Wilson IV

unread,
Nov 28, 2025, 3:07:10 PM (21 hours ago) Nov 28
to GAM for Google Workspace
Sent. Thanks again.

On Friday, November 28, 2025 at 10:12:04 AM UTC-8 Ross Scroggs wrote:
Send me a private Meet/Zoom invitation and I'll help.

Ross
----
Ross Scroggs


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Ross Scroggs

unread,
Nov 28, 2025, 3:09:09 PM (21 hours ago) Nov 28
to google-ap...@googlegroups.com
I'm available now if that works for you, otherwise we'll talk at 2.

Ross
----
Ross Scroggs


Reply all
Reply to author
Forward
0 new messages