Skip to content

Tool to change Google Apps primary domain and rename all users

Notifications You must be signed in to change notification settings

dougreese/ga-change-primary-domain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Change Primary Domain in a Google Apps Account

This is a tool to change Google Apps primary domain and rename all users, using the Google API Go client package.

Resources

Usage

  1. Set up your access to the Google API as described in the resources above
  2. Download the client_secret.json file from the developer console, place in the same directory as this project
  3. Build and run (or just run) the tool, passing the new and old domains as parameters
  4. Go to the URL displayed, which will perform the proper auth, paste token into console when prompted
  5. Confirm and off you go...

Examples

go run changeprimarydomain.go -new-domain my-new-primary-domain.com -old-domain my-old-promary-domain.com
go build changeprimarydomain.go
./changeprimarydomain -new-domain my-new-primary-domain.com -old-domain my-old-promary-domain.com

Notes

  • Works on OS X and Linux, unknown if this will work properly on Windows
  • Based on the Google Directory API Go Quickstart
  • To delete the cached auth credentials, remove the ~/.credentials/changeprimarydomain-<new domain>.json file
    • Example: rm ~/.credentials/changeprimarydomain-my-new-primary-domain.com.json
  • The 'Before you change your primary domain' document does not mention anything about renaming groups, but this console app does rename and alias all groups attached to the account
  • This console app can be run multiple times for the same new and old domains with no negative ramifications

About

Tool to change Google Apps primary domain and rename all users

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages