AppsScriptPulse

Google Apps Script Patterns: Keeping a gam generated users report up-to-date with Google Apps Script

In Google Workspace gam is probably the ‘go to’ tool command line tool which allows administrators to easily manage domain and user settings. Recently I was asked about how you can keep gam generated reports up-to-date using Google Apps Script. It’s worth remember that gam uses public Google Workspace APIs when it performs actions and reports. In this post I show you a pattern for building script to keep gam reports fresh.

Source: Google Apps Script Patterns: Keeping a gam generated users report up-to-date with Google Apps Script

Using Google Apps Script to get Google Workspace user profile pictures without using the Admin APIs

Image credit: Google

Chances are that you may need to display user’s picture profiles in your applications. However, this API is part of the Directory API, which is part of Google Workspace Admin area. And chances are that your Organization has simply not giving you the rights to use Admin APIs

Sometimes within your Google Workspace domain you’d like to include account profile images. A number of Google Workspace APIs, like the Drive API, will include profile pictures in the response object. When this isn’t the case this post by Turhan Oz is a nice reminder that the dedicated People API can be used to get profile images. Click through to the source post to read more and sample code.

Source: AppScript — get user profile picture without using Admin APIs

List all users of a Google Workspace domain, remove inactive users and force reset users’ passwords – Digital Inspiration

Amit Agarwal has recently been busy continuing to publish lots of incredibly useful Google Apps Script tips and snippets on his ‘Digital Inspiration’ blog. Three recent posts might be of particular interest to Google Workspace administrators:

[This Google Apps] Scripts gets the name and email address of users in the organization and saves the list inside a Google Spreadsheet. This script can only be executed by the domain administrator.

Source: List All Users of a Google Workspace Domain in Google Sheets – Digital Inspiration

Learn how the Google Workspace admin can change the Google account passwords of multiple users in their organization automatically with Google Apps Script.

Source: How to Force Reset Google Workspace Users’ Passwords with Apps Script – Digital Inspiration

Learn how to find inactive users in your Google Workspace domain and delete the dormant accounts to save on your monthly bills.

Source: Find and Remove Inactive Users in your Google Workspace Domain – Digital Inspiration

List All Users in an Organisation’s Google Workspace Account with Google Apps Script – Yagisanatode

Note! This tutorial is for Google Workspace for organisations and not the free consumer account, unfortunately. While the Google Apps Script docs provide a great example of how to get a list of users in a Domain on a Google Workspace account, it is not in the scope of the documentation to go into the weeds and explain all the ways we can search for all users.

In this tutorial, we will cover how to access your Google Workspace organisation’s user data, what data you can retrieve and how it looks, who can retrieve it and a couple of ways to display what you need.

Scott ‘Yagi’ Donald gives another thorough post for Google Apps Script users. Whilst targeted at Google Workspace users this tutorial has some great explanations of common Apps Script patterns, such as pagination and query parameters, that are useful to know when interacting with other Google APIs.

Source: List All Users in an Organisation’s Google Workspace Account with Google Apps Script – Yagisanatode

Using Google Apps Script to find/print inactive users in Google Workspace – xFanatical

In large organizations, it’s overwhelming for admins to find inactive users in the User List of Google Admin Console. These inactive users have not been logged in their Google accounts for a long period. It imposes a potential security risk to the organizational data if these accounts are not taken care of.  A free apps script to print all inactive users in Google Workspace. The following open source Google Apps Script can automate the process of printing inactive users in your domain.

Nice little snippet from xFanatical. Check out the source link for all the code and instructions for using.

Source: Print inactive users in Google Workspace – xFanatical