List groups of never logged in users

189 views
Skip to first unread message

Soporte Nubelista

unread,
Mar 21, 2023, 10:48:30 PM3/21/23
to GAM for Google Workspace
I have tried in various ways without success to list the users who have never logged in and the groups they belong to.

gam config csv_output_row_filter "lastLoginTime:regex:Never" print users fields primaryemail,lastlogintime | gam print groups member csvfile -:primaryEmail

Is this possible? I would appreciate any guidance on this.

Soporte Nubelista

unread,
Mar 21, 2023, 11:02:51 PM3/21/23
to GAM for Google Workspace
One more failed attempt...

gam config csv_output_row_filter "lastLoginTime:regex:Never" print users fields primaryemail,recoveryemail,lastname,firstname,creationtime,lastlogintime > no-login.csv
gam csv no-login.csv gam print groups member "~primaryEmail" > no-login-full.csv
cat *csv > combined.csv

Maj Marshall Giguere

unread,
Mar 21, 2023, 11:25:39 PM3/21/23
to google-ap...@googlegroups.com
$ gam config csv_output_row_filter 'lastlogintime:regex:^Never' print users fields ... >

Maj Marshall E Giguere

NH Wing Director of IT

Civil Air Patrol, U.S. Air Force Auxiliary

GoCivilAirPatrol.com

nhwg.cap.gov

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/10f12a57-629b-4315-a848-d358d1258b16n%40googlegroups.com.

Ross Scroggs

unread,
Mar 22, 2023, 10:34:54 AM3/22/23
to google-ap...@googlegroups.com

gam config csv_output_row_filter "lastLoginTime:regex:Never" redirect csv ./no_logins.csv print users fields lastlogintime

gam redirect csv ./no_logins_full.csv multiprocess gam user "~primaryEmail"  print users fields primaryemail,recoveryemail,lastname,firstname,creationtime,lastlogintime groups


groups will show two columns: GroupsCount: number of groups, and Groups: a space separated list of groups

groupsincolumns will show multiple columns: Groups: number of groups, Groups.0: first group, Groups.1: second group ...



Ross




--
Message has been deleted

Soporte Nubelista

unread,
Mar 22, 2023, 3:41:38 PM3/22/23
to GAM for Google Workspace
Hi Ross, thanks for your response.

The first command works fine, but the second command throws the following error (and I can't figure out how to fix it):

Command: /home/gam/.bin/gamadv-xtd3/gam redirect csv ./no_logins_full.csv multiprocess >>>gam<<< user ~primaryEmail print users fields "primaryemail,recoveryemail,lastname,firstname,creationtime,lastlogintime" groups

ERROR: Invalid choice (gam): Expected <all|cigroup|cigroup_users|cigroups|courseparticipants|cros|cros_ou|cros_ou_and_children|cros_ou_and_children_queries|cros_ou_and_children_query|cros_ou_queries|cros_ou_query|cros_ous|cros_ous_and_children|cros_ous_and_children_queries|cros_ous_and_children_query|cros_ous_queries|cros_ous_query|cros_sn|croscsv|croscsv_sn|croscsvdata|croscsvfile|croscsvfile_sn|crosfile|crosfile_sn|crosqueries|crosquery|csv|csvdata|csvdatafile|csvfile|csvkmd|csvsubkey|datafile|domains|domains_ns|domains_susp|file|group|group_inde|group_ns|group_susp|group_users|group_users_ns|group_users_select|group_users_susp|groups|groups_inde|groups_ns|groups_susp|licenses|oauthuser|ou|ou_and_children|ou_and_children_ns|ou_and_children_susp|ou_ns|ou_susp|ous|ous_and_children|ous_and_children_ns|ous_and_children_susp|ous_ns|ous_susp|queries|query|students|teachers|user|users>
Help: Syntax in file /home/gam/.bin/gamadv-xtd3/GamCommands.txt
Help: Documentation is at https://github.com/taers232c/GAMADV-XTD3/wiki


Soporte Nubelista

unread,
Mar 22, 2023, 6:00:56 PM3/22/23
to GAM for Google Workspace
Thanks for the reply, Maj. The command works, but I still have to list the groups of the "offline" users

Soporte Nubelista

unread,
Mar 22, 2023, 6:08:21 PM3/22/23
to GAM for Google Workspace
I tried modifying the command as follows:

gam redirect csv ./no_logins.csv multiprocess user "~primaryEmail"  print users fields primaryemail,recoveryemail,lastname,firstname,creationtime,lastlogintime groups

Getting the following error:

User: ~primar...@mydomain.com, Does not exist
El miércoles, 22 de marzo de 2023 a las 11:34:54 UTC-3, Ross Scroggs escribió:

Soporte Nubelista

unread,
Mar 24, 2023, 9:06:41 PM3/24/23
to GAM for Google Workspace
I have found the solution:

gam config csv_output_row_filter "lastLoginTime:regex:Never" redirect csv ./no_logins.csv print users fields lastlogintime && gam csv ./no_logins.csv gam user "~primaryEmail" print users fields primaryemail,recoveryemail,lastname,firstname,creationtime,lastlogintime groups > no_logins_groups.csv

Thanks for your help 
Reply all
Reply to author
Forward
0 new messages