New User Capture randomly generated password into a log file

93 views
Skip to first unread message

Prashant Nagaraj

unread,
Mar 19, 2025, 1:17:35 AMMar 19
to GAM for Google Workspace
Hello

At present we are using the below GAM command to create new users

===
gam config num_threads 1 redirect stdout {log_file_path} multiprocess redirect stderr stdout create user "{email}" firstname "{first_name}" lastname "{last_name}"  addnumericsuffixonduplicate 5 changepasswordatnextlogin on gal on suspended off address type work unstructured "{location}" primary  verifynotinvitable notify "{personalEmail},us...@mydomain.com,us...@mydomain.com,us...@mydomain.com" Subject "Welcome to mydomain :{first_name}" from "wel...@mydomain.com" htmlfile emailTemplates.html organization customtype "{company_name}" description "{employee_class}" costcenter "{division}" department "{business_unit}" title "{job_title}" primary externalid organization "{user_id}" relation manager "{manager_email}" displayname "{display_name}" recoveryemail "us...@mydomain.com"  org "/mydomain.com/PersonAccounts"'
===

My question is that is it possible to output the randomly generated password into a log file along with the newly_created user_account with which the password is associated with ?

Please let me know

Prashant Nagaraj

unread,
Mar 19, 2025, 1:18:44 AMMar 19
to GAM for Google Workspace
I am using GAMADV-XTD3

Ross Scroggs

unread,
Mar 19, 2025, 1:31:34 AMMar 19
to google-ap...@googlegroups.com
Add this to the end of the command: logpassword <FileName>

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/77aef78c-43a6-4b49-8fad-00295261c285n%40googlegroups.com.

Prashant Nagaraj

unread,
Mar 19, 2025, 8:19:03 AMMar 19
to google-ap...@googlegroups.com
I was getting
ERROR: Invalid argument for  >>>  logpassword <FileName> <<<

Using GAM Version : gam -version
GAMADV-XTD3 6.71.17 - https://github.com/taers232c/GAMADV-XTD3 - pyinstaller
Ross Scroggs <ross.s...@gmail.com>
Python 3.12.2 64-bit final
Linux Ubuntu 22.04 Jammy Jellyfish x86_64
Path: /home/amagi/bin/gamadv-xtd3
Config File: /home/amagi/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain:
Time: 2025-03-19T10:54:00+00:00

Upgrading to the latest GAMADV-XTD3 resolved the error and the password is stored in the file path along with the newly created user email address

Thanks Ross
.....
Thanks & Regards
Prashant N


You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/zV6r6fQ_RMU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/190BDB6C-9C2A-41DE-86B1-92F8EEC2130B%40gmail.com.

Ross Scroggs

unread,
Mar 19, 2025, 8:57:37 AMMar 19
to google-ap...@googlegroups.com

Prashant Nagaraj

unread,
Mar 19, 2025, 9:37:16 AMMar 19
to google-ap...@googlegroups.com
I just did the upgrade and the logpassword is working as expected

BTW, is there a difference between GAMADV-XTD3 and GAM7 

When we upgrade to the latest version does it upgrade to GAMADV-XTD3 version 7 and GAM7 ?
.....
Thanks & Regards
Prashant N

Ross Scroggs

unread,
Mar 19, 2025, 9:48:17 AMMar 19
to google-ap...@googlegroups.com
GAM7 is a repackaged version of GAMADV-XTD3, it is exactly the same code.
We are trying to get everyone to upgrade to GAM7.


Ross



--

Prashant Nagaraj

unread,
Apr 21, 2025, 6:30:56 AMApr 21
to google-ap...@googlegroups.com
Apologies for replying to this late

The unique passwords are printed as with logpassword command

Is it possible to add a CSV header like :
email,password

If so please let me know how 

.....
Thanks & Regards
Prashant N

Ross Scroggs

unread,
Apr 21, 2025, 10:36:48 AMApr 21
to google-ap...@googlegroups.com
The file you specify with logpassword is opened in append mode, put in whatever header row you want.

Ross
----
Ross Scroggs


Reply all
Reply to author
Forward
0 new messages