A comprehensive guide for setting up service accounts and Gclone
Table of Contents
Prerequisites
Prerequisite A - Install python
- Go to this link and install python, and don't forget to add to PATH
Prerequisite B - Create a Google Account
- Go to https://accounts.google.com and create a google account.
Prerequisite C - A Team Drive
- Go to https://td.msgsuite.workers.dev/ and create a team drive
Part A - Generating the Service Accounts
- Go to https://console.cloud.google.com/
- New Project
- 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
- 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.
- Open command prompt there, and follow the following commands:
pip3 install -U -r requirements.txt
python gen_sa_accounts.py
-> then authorisepython gen_sa_accounts.py --list-projects
py gen_sa_accounts.py --enable-services projectid
py gen_sa_accounts.py --create-sas projectid
py gen_sa_accounts.py --download-keys projectid
Replace projectid with your Project ID
- Accounts folder will be created > Go to it > open powershell there, and follow the following commands:
$emails = Get-ChildItem .\**.json |Get-Content -Raw |ConvertFrom-Json |Select -ExpandProperty "client_email" >>emails.txt
- An emails.txt file would be created
Part B - Adding these accounts to a google group
- Go to groups.google.com > create group > add name,mail > set settings as: conversation - group members ; who can post - manager ; who can view - manager
- Click next > directly add members > as group manager add 10 emails at a time from emals.txt file.
- There must be 101 members now. Get the group Email ID.
- Go to your team drive and add it there.
Part C - Setup Gclone
- Download gclone > make a folder on desktop named gclone > extract the gclone zip there.
- Copy the accounts folder previously created and paste it in the gclone folder. > rename any JSON file as 1.json
- Add the gc.bat file there [google drive link OR mediafire link OR zippyshare link]
- Run gc.bat file.
ENJOY GCLONE