Trying to pull a report to export a list of users for last login

1,423 views
Skip to first unread message

Rob Warren

unread,
Jul 5, 2016, 4:32:21 PM7/5/16
to Google Apps Manager
I am trying to run a report that will export a list of users that have not logged in since the beginning of the year. Below is a list of commands that I have tried. Can anyone tell me where I am going wrong?

c:\gam>gam report users filter 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter 'accounts:last_login_time<2016-01-01T00:00:00.000Z'
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report all users filter 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report all users 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam all users 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam users 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>
c:\gam>gam report all users accounts:last_login_time<2016-01-01T00:00:00.000Z > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report all users filter accounts:last_login_time<2016-01-01T00:00:00.000Z > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report all users filter 'prounlimited.com:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report all users filter 'prounlimited.com:last_login_time<2016-01-08T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report all users filter 'prounlimited.com:last_login_time<2016-08-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter 'prounlimited.com:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.cs
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter 'gmail:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter 'account:last_interaction_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter 'gmail:last_interaction_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter 'account:last_access_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter account:last_login_time<2016-01-01T00:00:00.000Z > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users account:last_login_time<2016-01-01T00:00:00.000Z > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter account: last_login_time<2016-01-01T00:00:00.000Z > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter account: last_login_time<2016-01-01T00:00:00.000Z > lastlogin.csv
The filename, directory name, or volume label syntax is incorrect.

c:\gam>gam report users filter account: last_login_time<2016-01-01T00:00:00.000Z> > lastlogin.csv
> was unexpected at this time.

Ross Scroggs

unread,
Jul 5, 2016, 9:37:36 PM7/5/16
to google-ap...@googlegroups.com
Rob,

c:\gam>gam report users filter 'accounts:last_login_time<2016-01-01T00:00:00.000Z' > lastlogin.csv
This gam command is correct but Windows is the problem. Single quotes in a Windows command box are often a problem,
the < between time and 2016 is being mis-interpreted because the single quotes are ignored. Use double quotes.
c:\gam>gam report users filter "accounts:last_login_time<2016-01-01T00:00:00.000Z" > lastlogin.csv

Moreno Nardelli

unread,
Jul 12, 2021, 10:30:24 AM7/12/21
to GAM for Google Workspace
Hi Ross,
I'm tring to export a report with this command for list  users in OU haven't never access...
gamadv report users ou all parameters accounts:last_login_time filters "accounts:last_login_time==#filtertime#" filtertime never
But I'm not sure this command considered the Gmail IMAP or POP access but only GMail Web access...

How can I do a report for list user haven't never access on the gmail web, IMAP and POP?

Thanks in advanced

Ross Scroggs

unread,
Jul 12, 2021, 1:55:25 PM7/12/21
to google-ap...@googlegroups.com
Moreno,

Start here:

gam report user services gmail parameters gmail:last_access_time,gmail:last_imap_time,gmail:last_interaction_time,gmail:last_pop_time,gmail:last_webmail_time


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/ea38c9e2-5a59-496f-8487-590641b4f2a0n%40googlegroups.com.


--

Moreno Nardelli

unread,
Jul 15, 2021, 5:02:01 AM7/15/21
to GAM for Google Workspace
Ok Thanks Ross!

Moreno Nardelli

unread,
Jul 15, 2021, 6:23:28 AM7/15/21
to GAM for Google Workspace
Sorry Ross, I have another question...
If I want a gam command who print me the persons haven't never access andt this persons where not member of a  group, can I modify the command:
gamadv report users ou all parameters accounts:last_login_time filters "accounts:last_login_time==#filtertime#" filtertime never
and what can i do it?

Ross Scroggs

unread,
Jul 15, 2021, 12:12:12 PM7/15/21
to google-ap...@googlegroups.com
Moreno,

You can not get what you want in a single command.
This Advanced GAM command will generate a CSV file that lists all users that don't belong to any group.
It has to make an API call per user so it might take a while if you have a large number of users.
You can replace 'all users' to select a subset of users; e.g., 'ou /Staff'.

gam config auto_batch_min 1 csv_output_row_drop_filter "'MEMBER:count>0','MANAGER:count>0','OWNER:count>0'" redirect csv ./NoGroupUsers.csv multiprocess all users print groups countsonly


You will have to merge this data with the data you get from the gam report command.


Ross




--

Moreno Nardelli

unread,
Jul 16, 2021, 1:42:51 AM7/16/21
to GAM for Google Workspace
ok thaks Ross, i'll be work on this way

Moreno Nardelli

unread,
Jul 20, 2021, 3:07:39 AM7/20/21
to GAM for Google Workspace
Hi Ross, can I ask you a question?
You can help me to understand the difference of this filters or where I can found a deep description of this:
accounts:last_login_time
gmail:last_access_time
gmail:last_imap_time
gmail:last_interaction_time
gmail:last_pop_time
gmail:last_webmail_time


Thanks in Advanced

Brian Kim

unread,
Jul 20, 2021, 4:33:08 PM7/20/21
to GAM for Google Workspace

Ross Scroggs

unread,
Jul 20, 2021, 7:38:05 PM7/20/21
to google-ap...@googlegroups.com
Moreno,

I know of nothing beyond the link that Brian posted.

Ross



--

Moreno Nardelli

unread,
Jul 23, 2021, 8:36:20 AM7/23/21
to GAM for Google Workspace
Ok Thanks Ross and Thanks Brian!

Moreno Nardelli

unread,
Jul 28, 2021, 5:59:22 AM7/28/21
to GAM for Google Workspace
Hi Ross,
I have an issue with this command...

gam report users select user us...@domain.com services gmail parameters gmail:last_access_time,gmail:last_imap_time,gmail:last_interaction_time,gmail:last_pop_time,gmail:last_webmail_time

This command provides output only this fields:
email,date
but not any gmail paramters

Brian Kim

unread,
Jul 28, 2021, 8:57:26 AM7/28/21
to GAM for Google Workspace
Which date is it returning? It's possible that Reports API is not returning any Gmail data for that specific date. You may want to change the date in GAM command to look at an earlier date.

Moreno Nardelli

unread,
Jul 29, 2021, 5:35:52 AM7/29/21
to GAM for Google Workspace
Thanks Bria
yes, the API not returning any Gmail data for that specific date. I must specific a olders date in the command...

Ian Crew

unread,
Jul 29, 2021, 11:03:34 AM7/29/21
to GAM for G Suite
Hi Moreno:

Try adding “ fulldatarequired all” to the end of your command. That should do the trick. Essentially, it automatically goes back through time until it finds a date—usually 2-3 days ago—where all the data has been populated.

Cheers,

Ian


 

Ian Crew

Solutions Architect
Productivity & Collaboration Services
Information Services and Technology

Moreno Nardelli

unread,
Jul 30, 2021, 9:16:35 AM7/30/21
to GAM for Google Workspace
Thanks Ian,
It's work, great!

Moreno
Reply all
Reply to author
Forward
0 new messages