The Admin SDK Reports service allows you to use the Admin SDK's Reports API in Apps Script. This API gives administrators of Google Workspace domains (including resellers) the ability to create custom usage reports for their domain.
Reference
For detailed information on this service, see the reference documentation for the Admin SDK Reports API. Like all advanced services in Apps Script, the Admin SDK Reports service uses the same objects, methods, and parameters as the public API. For more information, see How method signatures are determined.
To report issues and find other support, see the Admin SDK Reports support guide.
Sample code
The sample code below uses version 1 of the API.
Generate login activity report
This sample generates a login activity report for the last week as a spreadsheet. The report includes the time, user, and login result.
Generate user usage report
This sample generates a user usage report for this day last week as a spreadsheet. The report includes the date, user, last login time, number of emails received, and number of docs owned.