user report "gmail_*" fields

739 views
Skip to first unread message

Josef Fortier

unread,
Jan 27, 2015, 3:59:53 PM1/27/15
to google-ap...@googlegroups.com
Somewhere earlier this week it looks like

report users

lost gmail_* fields including

gmail_last_interaction_time

We have a set of "delegate only" accounts that I'd used this field to check if the accounts were active.

There are two (non-working) substitutes:

accounts_last_login_time
 accounts_last_sso_time

Which record direct user activity rather then the indirect activity of delegate access.

I'm hoping that someone here might suggest of an alternative. It seems at least somewhat likely that Google might be migrating this sort of query to the Gmail service account API, and, hope against hope that there's some provision in GAM :-)

Thanks!

David Carter Tod

unread,
Aug 5, 2015, 10:23:56 AM8/5/15
to Google Apps Manager
I imagine you worked this out, but for reference (and since I'd been struggling to find this information):

gmail:last_interaction_time

with a colon (:) after the namespace

Other gmail fields
https://developers.google.com/admin-sdk/reports/v1/reference/usage-ref-appendix-a/users-gmail

Similarly with docs use

docs:

GAM by default only seems to report the accounts: fields, but can report the others.

Thanks

Conway, Michael

unread,
Aug 14, 2015, 11:43:23 AM8/14/15
to google-ap...@googlegroups.com
Can you advise the command you are using for this? One of the "reports" I use regularly is

gam print users suspended creationtime lastlogintime changepassword licenses todrive

but the lastlogintime is misleading (unless the account has never been logged in to) since I have people sending emails every day who apparently haven't "logged in" for weeks or more.





Michael Conway
NFI Sr Systems Engineer
1005 Laurel Oak Road
Voorhees, NJ 08043
856-415-6104 Office
856-415-6091 Fax

 

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/e68ef14f-1b6e-4e77-96b7-48b073fcd1bf%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Please consider the environment before printing this e-mail.

This e-mail, including any attachments, contains information that may be privileged and confidential and subject to legal restrictions and penalties regarding its unauthorized disclosure or use. You are prohibited from disclosing, copying, distributing or otherwise using information in this e-mail if you are not the intended recipient. If you have received this e-mail in error, please notify me immediately by return e-mail or phone, and promptly delete this e-mail and all attachments from your system. Thank you!

David Carter Tod

unread,
Aug 14, 2015, 12:10:48 PM8/14/15
to Google Apps Manager
Good question. We have a lot of users (2 million or so), so I've tried a number of approaches. What I'm currently using is:

gam report users filter "accounts:last_login_time==1970-01-01T00:00:00.000Z,accounts:last_sso_time==1970-01-01T00:00:00.000Z,accounts:creation_time>2010-01-01T00:00:00.000Z,accounts:creation_time<2011-01-01T00:00:00.000Z" fields 'accounts:creation_time,accounts:last_login_time,accounts:last_sso_time'

or variations thereof. I'm using creation dates to constrain the result set and get the processing done on the server. In this example, I'm finding users who have never logged in and were created in 2010. I then can process the result with a "gam csv" command.

"print users" doesn't report last_sso_time


I thought gmail:last_interaction_time might work for me, but I'm not sure it does. I think maybe gam just doesn't support it, although the API should.

HTH

Josef Fortier

unread,
Aug 17, 2015, 1:24:40 PM8/17/15
to Google Apps Manager
Thank you! I'm glad I'm not the only one who wants this.

I thought gmail:last_interaction_time might work for me, but I'm not sure it does. I think maybe gam just doesn't support it, although the API should.

Not much luck on my end either, received a clipped version of today's date for everyone.

My boss has a 3rd party API reporting tool, and it lost the last_interaction value around the same time that GAM did, so it's at least reasonably possible that Google no longer supports last_interaction.

David Carter Tod

unread,
Aug 17, 2015, 1:49:07 PM8/17/15
to Google Apps Manager

No. The API supports it. You can do a “Try It” on this page:

 

https://developers.google.com/admin-sdk/reports/v1/reference/userUsageReport/get#try-it

 

Note that the userKey is the Google Unique ID, e.g. 1234216397316391143192

 

…debugs…

 

Aha! If you specify a date in the past, gmail:last_interaction_time IS available, e.g.

 

gam report users date 2015-08-10 user myu...@mydomain.com fields 'accounts:last_login_time,accounts:creation_time,gmail:last_interaction_time'

 

interestingly the data comes back in Google’s order, not the order you asked for, but it does come back.

 

email,date,accounts:creation_time,accounts:last_login_time,gmail:last_interaction_time

 

The implication is that there is a delay in making that data available.

 

David

Josef Fortier

unread,
Aug 17, 2015, 2:10:59 PM8/17/15
to Google Apps Manager
Thanks! This works for me. 

Aha! If you specify a date in the past, gmail:last_interaction_time IS available, e.g


I tried this with the 2015-08-10 date parameter. I'll poke around with other date values, but was wondering if you have already determined whether there's a range of dates that work, or any past date will work. 

Josef Fortier

unread,
Aug 17, 2015, 2:24:09 PM8/17/15
to Google Apps Manager
II'll poke around with other date values, but was wondering if you have already determined whether there's a range of dates that work, or any past date will work. 

The report date does make a difference (different values are reported back from different date reports).

The cutoff for my test case was a report date of 8/14, 8/15 pulls back nothing. I wouldn't be surprised if userbase size factor in here (we're tiny compared to you, about 10K users)

David Carter Tod

unread,
Aug 17, 2015, 2:30:16 PM8/17/15
to Google Apps Manager
I get the same behavior - 3 day delay. According to something I found elsewhere the data limit is 450 days, I think.

I'm trimming our users a bit, which is why I got interested in this report in the first place.

Josef Fortier

unread,
Aug 25, 2015, 3:55:07 PM8/25/15
to Google Apps Manager
Just to note, Looked at this yesterday, the time period was longer then 3 days. I've bumped up my script window to 6 days. But I've done no extensive testing.

Glen Pringle

unread,
Aug 25, 2015, 6:55:34 PM8/25/15
to google-ap...@googlegroups.com
Here's an earlier post I made about this issue.

This is related to the report date you specify. Google appears to batch report data every few days*. You can see the latest batch report date if you go to the main reports page in the admin console and look in the top right-hand corner (it is currently showing as June 18; the previous one was June 13 - hence the date you have). There is much more information available up to the latest batch date than a subsequent date.
 
* It would be nice if they did this consistently. Sometimes it can go for a couple of weeks with no updates, other times there's a new one every day.

I've just looked back through the report dates for the full reports that I've been downloading since March and the average delay between report dates is 3.4 days with the maximum delay 17 days. There doesn't appear to be any pattern to the gaps and the delay between the report date and when that report is available can also vary.

My approach is to check the reports section of the admin console regularly and download the reports for the new date when it appears.
--
Glen Pringle
Senior Business Analyst (Google Apps Specialist) | eSolutions | Monash University

On 26 August 2015 at 05:55, Josef Fortier <josef....@gmail.com> wrote:
Just to note, Looked at this yesterday, the time period was longer then 3 days. I've bumped up my script window to 6 days. But I've done no extensive testing.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

Ankiey

unread,
May 1, 2018, 3:14:33 PM5/1/18
to GAM for G Suite
Hi,

I was going through it and wonder if it is still issue

if it is you can simply use

gam report users fields "gmail:last_interaction_time" >Lastlogin.csv

where you can add any other field with account, gmail,drive in between those double quotes and the required output will be achieved.

Cheers


ITV plc (Registration No. 4967001) (ITV) is incorporated in England and Wales with its registered office at The London Television Centre, Upper Ground, London SE1 9LT. Please visit  www.itv.com for further information.

 

This email and any attachments are intended solely for the addressee and may contain confidential, copyrighted and/or privileged information.  If you have received this message in error, please notify us and delete it.  Recipients should scan the email and any attachments for their own protection. 

This email does not conclude a binding agreement.  The views or opinions presented in this email do not necessarily represent those of ITV.

Reply all
Reply to author
Forward
0 new messages