Generate Backup code for a list of users and save it into CSV or drive

203 views
Skip to first unread message

Ajo Jose

unread,
Apr 21, 2023, 5:29:14 AM4/21/23
to GAM for Google Workspace
Hi Team,

At the moment we are using this command 

gam user <username>|group <groupname>|ou <ouname>| file <filename> | all users show backupcodes

Can you all guide me to use it for a list of users(in a csv?) and then get the generated backup codes in to a csv or drive document.

Ross Scroggs

unread,
Apr 21, 2023, 11:02:49 AM4/21/23
to google-ap...@googlegroups.com
Ajo,

This is an Advanced GAM solution.
Generate backup codes

gam redirect stdout ./GenerateBackupCodes.txt multiprocess redirect stderr stdout csv Users.csv gam user "~User" update backupcodes


Print backup codes

gam redirect csv ./BackupCodes.csv multiprocess redirect stdout - multiprocess redirect stderr stdout csv Users.csv gam user "~User" print backupcodes


This makes a local CSV file of backup code, to get a drive document:

Replace "csv ./BackupCodes.csv multiprocess" with "csv - multiprocess todrive"


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/01627edc-4f43-48cc-8ed5-fca0d471c742n%40googlegroups.com.


--

Ajo Jose

unread,
Apr 21, 2023, 11:07:41 AM4/21/23
to GAM for Google Workspace
Hi Ross,

should I run both the commands?
Thanks in advance

Ross Scroggs

unread,
Apr 21, 2023, 11:10:52 AM4/21/23
to google-ap...@googlegroups.com
If you're trying to generate/update backup codes, then run the first command.

To list the current (or recently updated if you ran the first command) backup codes, then run the second command.

Ross



--

Ajo Jose

unread,
Apr 21, 2023, 11:12:30 AM4/21/23
to GAM for Google Workspace
Got it ,thanks a lot
Reply all
Reply to author
Forward
0 new messages