![](/img/trans.png)
[英]is it possible to lock a user account (g suite) programmatically using google apps scripts
[英]Programmatically fetch user's last login date to G Suite
在G Suite管理控制台上的用戶頁面上,管理員可以查看用戶的最后登錄信息。 例如,我看到的一個用戶的“上次登錄”日期是兩年前。
我正在嘗試以編程方式拉這個日期。 但是,提供有關登錄事件信息的Reports API只能追溯180天 。 Google如何獲得該登錄日期,並且可以通過API獲取該登錄日期?
Google之所以擁有此信息,是因為他們正在記錄該事件的發生時間並將其存儲在管理控制台中。 如果您現在開始構建應用程序並隨着時間的流逝開始存儲這些事件,那么您的日期也可以追溯到數年前。 如果G Suite Enterprise客戶在管理控制台中設置BigQuery日志,則可以無縫地執行此操作。
您現在應該可以獲取此信息。 查看GAMADV-XTD中使用的以下API,例如,可以使用此命令獲取此信息。
gam report users parameters accounts:last_login_time filters "accounts:last_login_time<#filtertime#" filtertime -5y
https://developers.google.com/admin-sdk/reports/v1/reference/activities https://developers.google.com/admin-sdk/reports/v1/reference/customerUsageReports https://developers.google。 COM /管理-SDK /報告/ V1 /參考/ userUsageReport
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.