A comprehensive Python-based toolkit for managing the user lifecycle within a Google Workspace domain. Developed during my IT internship at MOHI to automate onboarding, access control, and offboarding.
- Onboarding: Automatically sends HTML-formatted welcome emails to new staff with login credentials.
- Access Control: Bulk-adds users to Google Groups based on department or role.
- Offboarding: Automates the deletion of archived or departed user accounts.
- Security: Uses OAuth 2.0 and
.gitignoreto protect sensitive admin credentials.
- Language: Python 3.x
- APIs: Google Admin SDK (Directory API), Gmail API
- Libraries:
google-api-python-client,google-auth-oauthlib
User-Management/
├── scripts/
│ ├── delete_users.py # Offboarding logic
│ ├── manage_groups.py # Group management logic
│ └── send_welcome_emails.py # Onboarding/Gmail logic
├── templates/
│ └── welcome_template.html # Email HTML template
├── requirements.txt # Dependencies
└── .gitignore # Security exclusions
-
Install Dependencies:
pip install -r requirements.txt
-
Execution:
- To Offboard:
python scripts/delete_users.py - To Manage Groups:
python scripts/manage_groups.py - To Onboard:
python scripts/send_welcome_emails.py
- To Offboard:
-
Customization: Edit
templates/welcome_template.htmlto change the branding of onboarding emails without modifying the Python logic.
Sensitive files (credentials.json, token.json, and CSV data) are excluded from version control to maintain domain security.