Device Data Export?

76 views
Skip to first unread message

Jason Komendat

unread,
May 1, 2025, 10:45:49 AMMay 1
to GAM for Google Workspace
I'm trying to ultimatly script some data export and I'm sure this is a simple syntax ? but I found I can get the lasty IP and logged in user for a single device with this command

gam print cros query "id:SERIAL" fields serialnumber,lastsync,lastknownnetwork,recentusers listlimit 1

But I cannot find a way of exporting the same for all devices or all devices in a specific OU. I canget it from the GUI but thats not going to update. Is there a version of this for all devices?

Ross Scroggs

unread,
May 1, 2025, 10:54:48 AMMay 1
to google-ap...@googlegroups.com
See: https://github.com/GAM-team/GAM/wiki/ChromeOS-Devices#print-a-header-row-and-fields-for-selected-cros-devices

All devices
gam print cros fields serialnumber,lastsync,lastknownnetwork,recentusers listlimit 1

All devices in an OU
gam print cros cros_ou "/Path/To/OU" fields serialnumber,lastsync,lastknownnetwork,recentusers listlimit 1

Ross
----
Ross Scroggs



NOTICE: This communication and any response to it may constitute a public record, and therefore, may be available upon request under Iowa public records law, Iowa Code Chapter 22.

--
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/0a1d44a6-cecb-4e8c-942b-245a14e29f82n%40googlegroups.com.

Jason Komendat

unread,
May 1, 2025, 11:27:42 AMMay 1
to GAM for Google Workspace
gam print cros fields serialnumber,lastsync,lastknownnetwork,recentusers listlimit 1 was it, awesome, thanks

tcarter0

unread,
Oct 20, 2025, 10:53:20 AM (8 days ago) Oct 20
to GAM for Google Workspace
Years ago, before some of this information was accessible otherwise, we created a browser extension to log information about who's using our devices at login, screen unlock and periodically, including:

Local IP
Public IP
User Email
Device Name
Timestamp

With ChromeOS 138 , our extension no longer works, and we really don't want to have to recreate it if we don't have to. I'm not finding exactly what we need, either through GAM or the API's. The GAM command in this thread seems like it could almost work for us, but since the 'lastSync' timestamp is about policy sync rather than a user login event, I don't think that we could use it to map a user to a timestamp.

If I use 'listlimit 5', I can see that the lastSync timestamp is the same for each entry returned (5 different email addresses, all the same lastSync timestamp).

The information that we need is available in pieces, but not all together in a way that we can access it, or at least not that I've found so far. Is there a way for GAM to give us this information reliably with timestamps that correlate to the users? Or if not, any help with an API reference would be appreciated, but everything I've found so far lacks some of the information.

Thanks,
Tommy


tcarter0

unread,
Oct 20, 2025, 11:14:09 AM (8 days ago) Oct 20
to GAM for Google Workspace
I meant to add that since lastSync is always the same, understandably, in order for this command to do the trick, I would have to run it with 'listLimit 1' very frequently, and still run the risk of missing users that login between runs. The goal is to build a complete login history for the day, as opposed to just getting the most recent user.

Tommy
Reply all
Reply to author
Forward
0 new messages