Delegate access to another mailbox using Gsuite Admin

Step 1: Create a Service Account (Google Cloud)
Project Selection: Log in to the Google Cloud Console and select your project.

Enable APIs: Go to APIs & Services > Library, search for required APIs (e.g., Admin SDK API, Gmail API), and click Enable.

Create Account: Navigate to IAM & Admin > Service Accounts and click + Create Service Account.

Identity: Enter a name and ID, then click Create and Continue.

Skip Project Roles: Skip optional role assignments, as DwD permissions are managed in the Workspace Admin Console, not via IAM. Click Done.

Step 2: Download Credentials and Copy Client ID
Generate Key: Select your service account, go to the Keys tab, click Add Key > Create new key, choose JSON, and save the downloaded file securely.

Copy Client ID: On the Details tab, locate and copy the Unique ID (also called Client ID), which is a 21-digit numeric string.

Step 3: Authorize Domain-Wide Delegation (Google Admin)
Open Admin Console: Sign in to the Google Admin Console as a Super Administrator.

Navigate to API Controls: Go to Menu > Security > Access and data control > API controls.

Manage Delegation: Click Manage Domain Wide Delegation, then click Add new.

Authorize Scopes: * Client ID: Paste the numeric 21-digit ID copied in Step 2.

OAuth Scopes: Enter a comma-separated list of required scopes (e.g., https://www.googleapis.com/auth/gmail.settings.sharing).

Save: Click Authorize to finalize.

Place the file in the same location as the compiled binary.

Execute in package manager console Install-Package Google.apis.gmail.v1

and Install-Package Google.apis.auth

Leave a comment

Your email address will not be published. Required fields are marked *