Send errors by email

84 views
Skip to first unread message

Ryan Sousa

unread,
Jan 11, 2022, 8:08:06 AMJan 11
to GAM for Google Workspace
Is it possible for me to create emails by a csv and the errors that occur are sent by email?

I'm currently using this command:
gam csv G:/"Drives compartilhados"/Alunos_{}_"FAR".csv charset latin1 gam create user ~email firstname ~nome lastname ~sobrenome password ~cpf

Maj Marshall Giguere

unread,
Jan 11, 2022, 9:51:17 AMJan 11
to google-ap...@googlegroups.com
https://github.com/taers232c/GAMADV-XTD3/wiki/Tag-Replace
--
Maj Marshall E Giguere
NH Wing Director of IT
Civil Air Patrol, U.S. Air Force Auxiliary




Volunteers serving America's communities, saving lives, and shaping futures.


--
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/b21f03ce-6dcb-484c-a859-2adf84580e75n%40googlegroups.com.

Ryan Sousa

unread,
Jan 11, 2022, 3:36:51 PMJan 11
to GAM for Google Workspace
I couldn't formulate a command to do what I want. Can you help me?

Ross Scroggs

unread,
Jan 11, 2022, 3:39:30 PMJan 11
to google-ap...@googlegroups.com
Ryan,

I'm in California (PST, send me a Meet/Zoom invitation.

Ross



--

Ryan Sousa

unread,
Jan 11, 2022, 3:43:19 PMJan 11
to GAM for Google Workspace
Ross, I don't speak English. So a Meet/Zoom would be complicated.

Ross Scroggs

unread,
Jan 11, 2022, 3:57:39 PMJan 11
to google-ap...@googlegroups.com
Ryan,

With Advanced GAM you could do:
gam redirect stderr ./CreateUserErrors.txt multiprocess csv G:/"Drives compartilhados"/Alunos_{}_"FAR".csv charset latin1 gam create user ~email firstname ~nome lastname ~sobrenome password ~cpf
gam sendemail ad...@domain.com subject "Create User Error Log" file ./CreateUserErrors.txt

Ross

--
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/b21f03ce-6dcb-484c-a859-2adf84580e75n%40googlegroups.com.


--

Maj Marshall Giguere

unread,
Jan 11, 2022, 4:39:09 PMJan 11
to google-ap...@googlegroups.com
Ryan;


Essentially you need a csv file with columns named for each parameter of the create command, how you create the csv is purely up to you.  You then redirect the csv file to the create command using substitution to replace the tags with the values from the column from each row in the file.  So, something like this, assuming you have a csv file called "newusers.csv"

file: "newusers.csv"
primaryemail, password,firstname,lastname,notifyemail
us...@my.domain.com,abcdefg,Otto,lugnutt,ot...@nutz.com
...

you can create and notify your new users with GAMADV:
> gam redirect csv newusers.csv gam create user "~primaryemail" firstname "~givenname" familyname "~lastname" password "~password" notify "~notifyemail" subject "Welcome" notifypassword "~password" message "Welcome to your new account."

You can also use a template message file, my personal preference, to notify users and have gam fill-in the template tag fields from the csv file.


Maj Marshall E Giguere
NH Wing Director of IT
Civil Air Patrol, U.S. Air Force Auxiliary




Volunteers serving America's communities, saving lives, and shaping futures.

Ryan Sousa

unread,
Jan 13, 2022, 8:20:02 AMJan 13
to GAM for Google Workspace
Thank you very much, Ross. Worked perfectly!

Ryan Sousa

unread,
Jan 21, 2022, 8:56:07 AMJan 21
to GAM for Google Workspace
Ross, can you help me with another command that I'm not having success with? I'm trying to get all users from the @aluno.br domain and put them in an OU = suspended email. Can you help me?

Ross Scroggs

unread,
Jan 21, 2022, 9:47:50 AMJan 21
to google-ap...@googlegroups.com
Ryan,

gam redirect csv ./AlunoUsers.csv print users domain aluno.br
gam update ou "/SuspendedEmail" add csvfile AlunoUsers.csv:primaryEmail

Reply all
Reply to author
Forward
0 new messages