Code Monkey home page Code Monkey logo

bulk-rename-google-users's Introduction

Bulk Rename for Google Users and Groups

This repository contains handy scripts for renaming Google Workspace Users and Google Workspace Groups updating their primary email addresses and email aliases.

It works by doing the following:

  1. Fetch all users (or groups) that match the original domain as defined in the configuration (see below).
  2. Update users (or groups) primary email address replacing the original domain with a new domain.
  3. Fetch all user (or group) aliases using the original domain.
  4. Add new user (or group) aliases matching the original aliases but with the new domain.

Use case

If a Google Workspace organization updates their primary domain (like in the event of a company rebrand), users might need to have their primary email address updated to match the new primary domain.

Usage

Copy the config.rb.sample file into config.rb.

cp config.rb.sample config.rb

Update the config variables to match your requirements:

CREDENTIALS_PATH: This script is intended to use a credentials JSON for a Google Console service account. ADMIN_EMAIL: A service account needs to impersonate a domain administrator. This is usually you. ORIGINAL_DOMAIN: The domain that users will be renamed from (like example.com) NEW_DOMAIN: The domain that users will be renamed to (like new-example.com)

Install the pre-requisites:

gem install google-directory

Run the scripts to perform the updates:

ruby lib/update-users.rb
ruby lib/update-groups.rb

bulk-rename-google-users's People

Contributors

fsaravia avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.