CSV with inactive account

71 views
Skip to first unread message

Martin Vonášek

unread,
Sep 1, 2025, 5:39:45 AM9/1/25
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 AM9/1/25
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 AM9/2/25
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

Martin Vonášek

unread,
Sep 17, 2025, 3:31:52 PM9/17/25
to google-ap...@googlegroups.com
Thanks a lot for your answers, gam is a great tool, now I can find inactive accounts very quickly. 
Martin


út 2. 9. 2025 v 6:58 odesílatel 'Aston Wooller' via GAM for Google Workspace <google-ap...@googlegroups.com> napsal:

The information contained in this e-mail message and any accompanying files is or may be confidential. If you are not the intended recipient, any use, dissemination, reliance, forwarding, printing or copying of this e-mail or any attached files is unauthorised. This e-mail is subject to copyright. No part of it should be reproduced, adapted or communicated without the written consent of the copyright owner. If you have received this e-mail in error please advise the sender immediately by return e-mail or telephone and delete all copies. Stuff Limited does not guarantee the accuracy or completeness of any information contained in this e-mail or attached files. Internet communications are not secure, therefore Stuff Limited does not accept legal responsibility for the contents of this message or attached files.

--
You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/y9BcrEV8PIk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-manager/cef6a214-9ad5-44dd-ba33-7874fdd9e530n%40googlegroups.com.


--
Mgr. Martin Vonášek
(dějepis, mediální výchova, ICT ve vzdělávání)
Gymnázium Hladnov a Jazyková škola s právem státní jazykové zkoušky,
Ostrava, příspěvková organizace
Ostrava–Slezská Ostrava,
Hladnovská 35, 710 00
http://www.hladnov.cz
596 241 073



Reply all
Reply to author
Forward
0 new messages