CSV with inactive account

34 views
Skip to first unread message

Martin Vonášek

unread,
Sep 1, 2025, 5:39:45 AM (5 days ago) Sep 1
to GAM for Google Workspace
Hi,

can I got csv with accounts who are not longer active (e.g. one year), because we would like to delete this accounts?

Thank for your help 

Ross Scroggs

unread,
Sep 1, 2025, 11:53:58 AM (4 days ago) Sep 1
to google-ap...@googlegroups.com

gam redirect csv ./LastLogin.csv print  users lastlogintime   


Ross

----
Ross Scroggs



--
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/3422dd54-050e-4906-944d-f7084155d00en%40googlegroups.com.

Aston Wooller

unread,
Sep 2, 2025, 12:58:20 AM (4 days ago) Sep 2
to GAM for Google Workspace
Hey Martin

In addition to Ross' suggestion, you can filter the output when exporting to CSV. 

gam config csv_output_row_filter "'lastLoginTime:date<-365d'" redirect csv ./LastLogin.csv print users lastlogintime


However, setting the filter to over 365 days ago does count 'never' as over 365 days ago and you're reporting on all users including those that you might've already archived or ones that might not be logged into directly (like shared mailboxes). So you might want to filter by another field as well. So here's an example of users who haven't logged in in the last 365 days AND are not in the '_Terminated Staff' OU or any of its children.

gam config csv_output_row_filter "'lastLoginTime:date<-365d','orgUnitPath:notregex:/_Terminated Staff'" redirect csv ./LastLogin.csv print users lastlogintime ou

Aston
Reply all
Reply to author
Forward
0 new messages