Order of fields in print users report

68 views
Skip to first unread message

FG@LAPU

unread,
May 14, 2019, 2:41:46 PM5/14/19
to GAM for G Suite
Hi.

I would like to sync a G-Suite user list into an SQL database using a flat file as source generated by

gam print users aliases schemas Extras > users.csv

This works fine. However, I notice the order of the fields/columns in the CSV is a bit weird. The  header I get from the command above looks like this:

primaryEmail,id,aliases,nonEditableAliases,nonEditableAliases.0,aliases.0,customSchemas.Student_Information.Student_ID,nonEditableAliases.1,aliases.2,aliases.1,nonEditableAliases.2,aliases.3,nonEditableAliases.3,nonEditableAliases.5,nonEditableAliases.4,aliases.5,aliases.4

I wonder if the order will be the same all the time? And, if the header names change, that would be bad.

Ross Scroggs

unread,
May 14, 2019, 4:55:46 PM5/14/19
to google-ap...@googlegroups.com
FG,

gam print users aliases schemas Extras sortheaders > users.csv

What do you mean "if the header names change"?

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/31ec45cd-45d1-4b96-b8c1-72df690d6c7d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

FG@LAPU

unread,
May 17, 2019, 4:31:50 PM5/17/19
to GAM for G Suite
Hi Ross,

I am mainly concerned whether the order of the columns might change,
e.g. from the current
primaryEmail,id,aliases,nonEditableAliases,nonEditableAliases.0,aliases.0,customSchemas.Student_Information.Student_ID,nonEditableAliases.1,aliases.2,aliases.1,nonEditableAliases.2,aliases.3,nonEditableAliases.3,nonEditableAliases.5,nonEditableAliases.4,aliases.5,aliases.4
to something more naturally sorted
primaryEmail,id,aliases,nonEditableAliases,nonEditableAliases.0,aliases.0,nonEditableAliases.1,aliases.1,aliases.2,nonEditableAliases.2,aliases.3,nonEditableAliases.3,nonEditableAliases.4,nonEditableAliases.5,aliases.4,aliases.5,customSchemas.Student_Information.Student_ID

but also wondered if the column name schema could change, e.g. from aliases.4  to alias4.

Ross Scroggs

unread,
May 17, 2019, 5:17:16 PM5/17/19
to google-ap...@googlegroups.com
FG,

aliases.4 will not change to aliases4

If you use the command I suggested:
gam print users aliases schemas Extras sortheaders > users.csv
the the column order will be stable.

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.


--

FG@LAPU

unread,
May 17, 2019, 6:12:38 PM5/17/19
to GAM for G Suite
Nice, this is exactly what I was looking for. Thanks, Ross!

+KimNilsson

unread,
Jun 16, 2019, 2:56:23 PM6/16/19
to GAM for G Suite
But, I assume you also know that there will maybe be more headers than the first time you run the print?
If a single user has six aliases, you will get more headers, and empty values for all other users.
Reply all
Reply to author
Forward
0 new messages