A comprehensive guide for setting up service accounts and Gclone


Table of Contents

Prerequisites

Prerequisite A - Install python

  1. Go to this link and install python, and don't forget to add to PATH

Prerequisite B - Create a Google Account

  1. Go to https://accounts.google.com and create a google account.

Prerequisite C - A Team Drive

  1. Go to https://td.msgsuite.workers.dev/ and create a team drive

Part A - Generating the Service Accounts

  1. Go to https://console.cloud.google.com/
  2. New Project
  3. Give name > create > select the created project > API and Services > Credentials > Oauth Consent Screen > External > Create > App name and Email > Skip the scopes > Add your mail as test user > back to dashboard > publish app > confirm
  4. Go to credentials > create credentials > Oauth Client ID > Apptype - desktop app, default name > go to Library > Google Drive API > enable > Credentials of google drive api > download as JSON, rename as credentials.json > make folder on desktop as Service accounts [extract mediafire link OR google drive link here] > paste the credentials.json there.
  5. Open command prompt there, and follow the following commands:
    1. pip3 install -U -r requirements.txt
    2. python gen_sa_accounts.py -> then authorise
    3. python gen_sa_accounts.py --list-projects
    4. py gen_sa_accounts.py --enable-services projectid
    5. py gen_sa_accounts.py --create-sas projectid
    6. py gen_sa_accounts.py --download-keys projectid
      Replace projectid with your Project ID
  6. Accounts folder will be created > Go to it > open powershell there, and follow the following commands:
    1. $emails = Get-ChildItem .\**.json |Get-Content -Raw |ConvertFrom-Json |Select -ExpandProperty "client_email" >>emails.txt
  7. An emails.txt file would be created

Part B - Adding these accounts to a google group

  1. Go to groups.google.com > create group > add name,mail > set settings as: conversation - group members ; who can post - manager ; who can view - manager
  2. Click next > directly add members > as group manager add 10 emails at a time from emals.txt file.
  3. There must be 101 members now. Get the group Email ID.
  4. Go to your team drive and add it there.

Part C - Setup Gclone

  1. Download gclone > make a folder on desktop named gclone > extract the gclone zip there.
  2. Copy the accounts folder previously created and paste it in the gclone folder. > rename any JSON file as 1.json
  3. Add the gc.bat file there [google drive link OR mediafire link OR zippyshare link]
  4. Run gc.bat file.

ENJOY GCLONE

Edit
Pub: 18 Feb 2022 10:19 UTC
Edit: 18 Feb 2022 12:29 UTC
Views: 208