This is a simple script designed to return the editors of a Google Sheet.
First, open the Sheet that you want to audit.
Select the “Extensions” option in the menu, then select, “Apps Script”.
You will need to add the required services on the left side. Click Srevices, and slowly add each service. You have to do them one-by-one.
Next, you can use the existing file, Code.gs, or make a new one.
You want to paste the code below into the white space, and then click the DISK ICON to save the script.
function onEdit(e) {
// Get the active document
var doc = DocumentApp.getActiveDocument(); //You can make this //function external, outside the sheet, and use the sheet ID
// Retrieve the user's email. Note: This will only work for users within your Google Workspace domain
var userEmail = Session.getActiveUser().getEmail();
// Get the current date and time
var timestamp = new Date();
// Log the user's email and timestamp
Logger.log('Document edited by: ' + userEmail + ' at ' + timestamp);
// Optionally, you can record this information in a Google Sheet or elsewhere
// Example: recordEdit(userEmail, timestamp);
}
After you have copied and saved the script, hit the play button to run it. The first time you do this, you will have to accept the permissions.
Results will appear at the bottom in the Logger/Console.