Let’s continue the presentation of examples of use event logs from Google Workspace. Today I’ll describe how to use event logs to check and notify users about outdated versions of the operating system. The idea is to inform users via email that newer versions of the operating systems are available to install. Described methods work for all popular operating systems - e.g. MacOS, Windows, Linux, iOS or Android.
Keep in mind that this method only notify users and/or administrators. The next step is to enforce installation of the new version. MDM systems can enforce such installation or we can use Google Workspace Context-Aware Access to prohibit older versions.
Described use case: User just after login to Google Workspace receives notification via email that newer version of the operating system is available.
The main function is main_version_monitor(). The first function is read_dates(). The function is using a spreadsheet to store the date of the last execution of the script. The main function should be executed at least every 5-10 minutes in order to notify users as soon as possible. We use the last execution date because in the next function read_events() is calling AdminReports.Activities.list() GSuite API which retrieves a list of activities. The read_events() collect 6 types of data from Google Workspace events: DEVICE_TYPE, DEVICE_MODEL, OS_VERSION, SERIAL_NUMBER, date and email of user.
response = AdminReports.Activities.list(
if (params_event[zm4].name == "DEVICE_TYPE")
device_type_vod = params_event[zm4].value;
if (params_event[zm4].name == "DEVICE_MODEL")
device_model_vod = params_event[zm4].value;
if (params_event[zm4].name == "OS_VERSION")
os_version_vod = params_event[zm4].value;
if (params_event[zm4].name == "SERIAL_NUMBER”
serial_id_vod = params_event[zm4].value;
Function is quite simple:
var handler_to_file = open_spreadsheet_file("", "supported versions");
for(var zmx = 1; zmx<handler_to_file.length;zmx++ )
if(handler_to_file[zmx] == version_to_check)
Finally, we have to prepare a message which will be sent via email.