gam print | gam csv command

11,285 views
Skip to first unread message

RISL

unread,
Apr 12, 2016, 7:24:59 AM4/12/16
to Google Apps Manager
Hi guys,

First, I wound like to thank you for such a great tool!

Second, I have successfully run this command:

gam print users | gam csv - gam update user ~primaryEmail changepassword off

and it's worked like a charm!

However I have a question about this part "gam print users | gam csv" of the command. Is using this command created a CSV file for all users into the GAM folder? or it was just like a cached data?

Best,
RISL

Jay Lee

unread,
Apr 12, 2016, 7:32:55 AM4/12/16
to Google Apps Manager

The first gam command prints all users. | (pipe) is an OS operative that tells your system to take the output of the first command and make it the input of the second command. In the second command, - is a special name for the CSV file that tells gam to look at the input rather than a file on disk for CSV data. The CSV data should not be written to disk.

Jay


--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" 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/1665d323-5692-464e-bdc2-ba46462d004f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jay Lee

RISL

unread,
Apr 12, 2016, 7:44:02 AM4/12/16
to Google Apps Manager
Thanks for clarifying.

However I still wish to understand more about the usage this command. What will happen if I run "gam print users" command alone?

On Tuesday, 12 April 2016 13:32:55 UTC+2, Jay Lee wrote:

The first gam command prints all users. | (pipe) is an OS operative that tells your system to take the output of the first command and make it the input of the second command. In the second command, - is a special name for the CSV file that tells gam to look at the input rather than a file on disk for CSV data. The CSV data should not be written to disk.

Jay


On Tue, Apr 12, 2016, 7:24 AM RISL <google...@islschools.org> wrote:
Hi guys,

First, I wound like to thank you for such a great tool!

Second, I have successfully run this command:

gam print users | gam csv - gam update user ~primaryEmail changepassword off

and it's worked like a charm!

However I have a question about this part "gam print users | gam csv" of the command. Is using this command created a CSV file for all users into the GAM folder? or it was just like a cached data?

Best,
RISL

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
--

Jay Lee

Jay Lee

unread,
Apr 12, 2016, 8:18:37 AM4/12/16
to Google Apps Manager

It will print all your users to the screen since you didn't pipe the output anywhere else. You could also add "to drive" to the end to send the results to a Google spreadsheet instead of the screen.

Jay


On Tue, Apr 12, 2016, 7:44 AM RISL <google...@islschools.org> wrote:
Thanks for clarifying.

However I still wish to understand more about the usage this command. What will happen if I run "gam print users" command alone?

On Tuesday, 12 April 2016 13:32:55 UTC+2, Jay Lee wrote:

The first gam command prints all users. | (pipe) is an OS operative that tells your system to take the output of the first command and make it the input of the second command. In the second command, - is a special name for the CSV file that tells gam to look at the input rather than a file on disk for CSV data. The CSV data should not be written to disk.

Jay


On Tue, Apr 12, 2016, 7:24 AM RISL <google...@islschools.org> wrote:
Hi guys,

First, I wound like to thank you for such a great tool!

Second, I have successfully run this command:

gam print users | gam csv - gam update user ~primaryEmail changepassword off

and it's worked like a charm!

However I have a question about this part "gam print users | gam csv" of the command. Is using this command created a CSV file for all users into the GAM folder? or it was just like a cached data?

Best,
RISL

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" 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.
--

Jay Lee

Ross Scroggs

unread,
Apr 12, 2016, 10:28:53 AM4/12/16
to google-ap...@googlegroups.com
Autocorrect, can't live with it, can't live without it; that is "todrive" not "to drive".

Summary:
Print users to screen: gam print users
Print users to a file: gam print users > users.csv
Print users to a Google Spreadsheet: gam print users todrive


Cristiane A. Ruiz N. Cardoso

unread,
Mar 31, 2025, 12:58:43 PM3/31/25
to GAM for Google Workspace
Hello Guys, 

Through a file called list.csv that has 90 usernames I would like to get the emails of the respective users.

  Is this GAM command working correctly? If not, what is the correct syntax?
gam csv list.csv gam print users query "name:~name" fields primaryEmail > result.csv  

I’m trying to retrieve users' primary emails from a CSV file containing only names. However, the output file is empty.

✅ The lista.csv file has this format:

name 
Username as it appears in the console

The command doesn’t return any results.

🔹 I used fullName instead of name in the query.
🔹 I used to format the CSV utf8.

Any help is appreciated! Thanks in advance.

Thanks a bunch.






Ross Scroggs

unread,
Mar 31, 2025, 1:01:35 PM3/31/25
to google-ap...@googlegroups.com

gam csv list.csv gam print users query "name:~~name~~" fields primaryEmail > result.csv  

Ross
----
Ross Scroggs



"Esta mensagem é confidencial e destinada apenas ao destinatário. Caso a tenha recebido por engano, delete-a e avise o remetente.
Estamos em conformidade com a LGPD (Lei nº 13.709/2018). Para mais informações, consulte nossa política de privacidade."

"This message is confidential and intended only for the recipient. If you have received it by mistake, delete it and notify the sender.
We comply with the LGPD (Law No. 13.709/2018). For more information, please refer to our privacy policy."


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

Cristiane A. Ruiz N. Cardoso

unread,
Mar 31, 2025, 1:45:52 PM3/31/25
to GAM for Google Workspace
Hello Ross. 

All very well

Thanks a bunch

Reply all
Reply to author
Forward
0 new messages