-2

I have a google Script to Fetch the below details of the user accounts. However I do not see a SUSPEND DATE of GOOGLE Account? If there any field or function which can get this value.

The script is able to fetch the below values of the users.

Full Name Email First Name Last Name Last Login Suspend Status Suspend Reason Create date

1 Answers1

0

Looking at the User Resource reference, there is no property to track the time when a user account was suspended (only related properties are creationTime and deleteTime).

So there is no built-in way to track (historically) when a user was suspended. But you can build a custom solution to store dates/timestamps when a user is suspended.

You'll need to leverage Admin Directory API Push Notifications to track when a user account is updated. This allows you to track changes to the suspended property on a user resource; once you figure that out all you need to do is store a timestamp when it changes from false to true.

The following stackoverflow thread should help to get you up to speed on how to set up push notifications for the Admin Directory API. The rest is up to you:

Is it possible to watch Directory API changes from Google App Maker/Google Apps Script?

TheAddonDepot
  • 8,408
  • 2
  • 20
  • 30