A set of tools designed to facilitate the on-boarding of G Suite email
users with the G Suite API
Note: this was built with OS X in mind, but could be modified without too much
trouble for other platforms since it is Java based
- Account creation
bash gsuite -p <path_to_csv> --create
- Email group additions
bash gsuite -p <path_to_csv> --add
Use the --help flag for help and information on commands
- Super Admin level GSuite account
client_secret.json
- gradle 3.5 or higher
- Java 1.8 (JRE 8) or higher
- To see if G Suite API's are enabled
- To research the Admin SDK API
- To enable the Admin SDK API
- To get the
client_secret.json
file
Note: client_secret not client_secrets
- Clone this repo to desired location
- Install gradle via homebrew
- Download and install JRE 8
- Either follow the build instructions at bottom or use my build script
bash install.sh
Create a UTF-8 encoded CSV file with format described here
$ bash gsuite --help
Usage: bash gsuite [OPTIONS] [-p <PATH_TO_DATA_FILE>]
[OPTIONS]
-a --add --groups Add members to a group. [REQUIRES PATH]
-c --create Create new users. [REQUIRES PATH]
-d --debug Print extra details for debugging.
-n --dry Do a dryRun. Doesn't make any changes.
-e --example Print out a line of the expected headers for imports.
-? -h --help Print this message then exit.
-lg --list-groups List all groups in domain.
-lu --list-users List all users in domain.
-p --path Defines next arg as (full) path to UTF-8 csv formated data file.
-r --reset Reset permission levels after changing scopes.
-t --test Test method for new implementations.
-u --update Update organization fields of users. [REQUIRES PATH]
-v --verbose Turn on full output.
For more help, see documentation in HELPME.md
Contributions are welcome and wanted.
Keep in mind that you will need to add your own API token to use this software
and should likely tailor it to fit your needs.
To make changes, go to the build folder build-gsuite/
If you see a bug or have questions, open an issue and I'll get back to you on it.
Input: CSV file with user data
Output: Success/Failure report to run given command on each user
- Java source files in build-gsuite/src/main/java
- Files for testing are in build-gsuite/src/test
- API Token is stored at build-gsuite/src/main/resources/client_secret.json
- Credentials will be saved to the home directory during run-time
- To manage dependencies for installing new/updated libraries,
edit thebuild.gradle
file. - To add features to the main tool, edit the Java source files
- For a list of all gradle tasks:
gradle tasks
- To build/use the project:
gradle run
With parameters:gradle run -P myArgs="['--some-args','-i','-n',-this-format']"
- To run
unitintegration tests:gradle test
- Make sure you have a file to test on in
src/test/resources/testData.csv
- Make sure you have a file to test on in
- To make a clean slate before build:
gradle clean
- To create a new release:
- Delete the old release (or keep it I guess?)
rm -rf ../gsuite-#.#.#
- Update the version number in
build.gradle
- Assemble distribution:
gradle buildNeeded
(you might only needgradle distTar
to accomplish this step) - Move the build up to the repo and unpack it
mv build/distributions/gsuite*.tar ..
tar -vxf ../gsuite*.tar
- Delete the old release (or keep it I guess?)