Updating the Title field using GAM

994 views
Skip to first unread message

Keith Larson

unread,
Oct 11, 2021, 12:35:11 PM10/11/21
to google-ap...@googlegroups.com
Can someone please help me with the syntax to update the Title field using GAM?  The challenge is that there appears to be two and I'm not sure that both of them are exposed.  I have a sysadmin that showed me that when you create a query for a dynamic group, the contents of both fields are mapped to the same Google attribute.  That results in the query that puts this user in the same group for two different values and this causes problems.

Here is some more specific data.  When I run gam user info, this is a portion of what is returned:

Gender
 type: male

Organizations:
 title: Teacher
 location: WES

 name:
 title: Admin
 primary: True
 customType: work
 location: WES

Locations:
 type: desk
 area: desk
 buildingId: WES

You can see that there is this Organizations: Title that contains Teacher and a name: Title that contains the value Admin.  If you write a dynamic group query, the only option is Job.Title, but when Google executes this query it displays as org.title.  This user matches for org.title==Admin AND also matches when the query is org.title==Teacher so he ends up in both groups when he shouldn't be.

I need to remove the Organizations: title: Teacher, but cannot find how to address this field.


Marc Anderson

unread,
Oct 11, 2021, 2:51:20 PM10/11/21
to GAM for Google Workspace
The syntax I use to update that field is: gam update user us...@domain.com firstn... {other field updates here}  ... organization title "new title here"

Ross Scroggs

unread,
Oct 11, 2021, 3:07:39 PM10/11/21
to google-ap...@googlegroups.com
Replae the two organizations with one.
gam update user us...@domain.com organization title Admin localtion WES primary 

--
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/CAJWqRyF_nwS%2BmC3eKxTKJXx4R%2BmRYy-b7%3DqhsiAGSpFiiqMYrA%40mail.gmail.com.

Keith Larson

unread,
Oct 11, 2021, 3:26:30 PM10/11/21
to google-ap...@googlegroups.com
what about removing the value completely?  
here is some more detail about the challenge.  these fields got populated somehow by gcds, but the current version of gcds seems to only update one of them.  we want to maintain it with gcds, so manually correcting both with GAM just adds a manual step to the process that I don't want.  i'd like to clean up the extra value and maintain one through the profile mapping in gcds.


Ross Scroggs

unread,
Oct 11, 2021, 3:44:42 PM10/11/21
to google-ap...@googlegroups.com

Keith Larson

unread,
Oct 11, 2021, 3:45:36 PM10/11/21
to google-ap...@googlegroups.com

Keith Larson

unread,
Oct 11, 2021, 3:50:31 PM10/11/21
to google-ap...@googlegroups.com
that did the trick (except for the typo).  thank you.


Timothy Musa

unread,
Apr 6, 2022, 12:08:48 PM4/6/22
to GAM for Google Workspace
This has definitely helped point me towards what we are look, but it seems to be not quite there. 
We used to sync our data with a local LDAP system using the Google Cloud Directory Sync. That process went away a few years ago, leaving most of our users with Organization / Location information that cannot be updated easily with our new system. The Organization / Title and Department are editable through the Google Admin Panel, but the Location isn't. At this point, Ideally we would just clear out the Location data, leaving any existing Title and Department data.
However the command I tried:
gam update user user@domain Organization location "" primary
Cleared out everything, leaving just a blank location field.
Is there an easy way to clear that single field? Or maybe I can just export all of the user Organization data to a CSV and then use that CSV to do an update after removing the location column?

Ross Scroggs

unread,
Apr 6, 2022, 12:29:25 PM4/6/22
to google-ap...@googlegroups.com
Timothy,

GAM doesn't support clearing a single subfield so your output to a CSV file, clear the location column and update from the CSV file is the way to go.

CONFIDENTIALITY NOTICE: This e-mail message, including any attachment(s) or any portion of the message herein, is intended only for the person to whom it is addressed and may contain confidential and/or privileged material. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message. If you are the intended recipient but do not wish to receive communications through this medium, please so advise the sender immediately. 


--
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.

Timothy Musa

unread,
Apr 6, 2022, 12:46:42 PM4/6/22
to GAM for Google Workspace
Thank you for that super quick response. The more I looked he more that seemed to be the case. Glad to have this confirmation of that though.
Reply all
Reply to author
Forward
0 new messages