How to Share a User on a Published Google Site with Google Apps Script

There are times when you might just want to share a user on a published Google Site as a part of a Google Apps Script Automation. Say you have an internal Google Site for a project and you want to share it with a member as a part of the onboarding process. Alternatively, you might want to share your site as soon as you receive a Stripe payment webhook ping.

To share a user in Google Sites you need to select the share icon from the top menu of the site editor. Then in the dialogue box add the user’s email and choose Published Viewer.

Give Published Viewer access to a Google Site

While there is no specific Google Apps Script API to manage Google Sites, we can share permissions and accessibility with Google Drive.

Continue reading “How to Share a User on a Published Google Site with Google Apps Script”

Get a list of Google Shared Drives by ID and Name in Google Apps Script [updated 16 Dec 2022]

If your organisation is using Google Workspace Business Standard, Business Plus, Enterprise, or one of the other supported plans, you are likely taking advantage of the power of Google’s Shared Drives.

If you have decided to create a Google Apps Script project that needs to get a list of your Shared Drive (or a user’s shared drives in the case of a WebApp), then you might be scratching your head right now wondering how to get this list using the built-in DriveApp class.

Whelp, unfortunately, at the time of writing this article the DriveApp class does not have this functionality. However, it is pretty easy to access in a single line of code using an Advance API.

Here’s what you need to do:

As always, read what you need and skip the rest. 

Continue reading “Get a list of Google Shared Drives by ID and Name in Google Apps Script [updated 16 Dec 2022]”