Skip to content

ivancarlosti/gwadmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Google Workspace admin script (gwadmin)

A PowerShell launcher for common Google Workspace administration tasks driven by GAM. Designed around offboarding-style operations: archiving a user's mailbox into a group, moving their Drive content into a Shared Drive, transferring their calendars and event-organizer rights to another account, and managing mailbox delegation.

Stars Watchers Forks Downloads GitHub commit activity GitHub Issues
License GitHub last commit Security Code of Conduct
GitHub Sponsors Buy Me a Coffee

Features

The launcher exposes a numbered menu. Each item validates the admin account, the source mailbox, and (where applicable) the target before running its GAM command.

  1. Copy mailbox messages to a group — archives every message from a user mailbox into a Google Group's archive.
    gam user <source> archive messages <targetGroup> max_to_archive 0 doit
    
  2. Move Drive content to a new Shared Drive — creates a fresh Shared Drive named Migrated from <source> - <datetime> and moves the source user's My Drive content into it.
    gam user <admin>  create teamdrive "Migrated from <source> - <datetime>"
    gam user <admin>  add drivefileacl <sdid> user <source> role organizer
    gam user <source> move drivefile root teamdriveparentid <sdid> mergewithparent
    
  3. Transfer calendars to another account — reassigns secondary calendars and, for the primary calendar (which Google won't let you transfer), reassigns the organizer of all future events to the target user. After this runs, the target user can cancel those events and Google will send proper cancellation notices to invitees, even if the source user is later deleted.
    gam user <source> transfer calendars <target>
    gam user <source> update event <eventid> calendar primary newowner <target>
    
  4. List / add / remove mailbox delegation — manage who has delegated access to a mailbox.
    gam user <source> show delegates
    gam user <source> add delegates <delegate>
    gam user <source> del delegates <delegate>
    
  5. Change GAM project — re-select which GAM multi-project profile to use.
  6. Exit script.

Configuration

Set variables at the top of gwadmin.ps1 if your install differs from the defaults:

$GAMpath = "C:\GAM7"
$gamsettings = "$env:USERPROFILE\.gam"
$destinationpath = (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path

$GAMpath — the GAM application folder.

$gamsettings — the GAM multi-project settings folder.

$destinationpath — where any local output ends up (currently used only for temp files).

Check testing-guideline.md as a suggested testing checklist.

Instructions

  • Download the latest release and extract it locally (releases).
  • Adjust the variables in gwadmin.ps1 if needed.
  • Run gwadmin.ps1 from PowerShell (right-click → Run with PowerShell, or powershell -ExecutionPolicy Bypass -File .\gwadmin.ps1).
  • Pick a GAM project, then choose a menu option and follow the prompts.

If PowerShell blocks the script with "Running scripts is disabled on this system", see POWERSHELL_ISSUE.md.

Requirements

  • Windows 10+ or Windows Server 2019+
  • GAM installed and configured for multi-project use
  • PowerShell 5.1 or later

🧑‍💻 Consulting and technical support

  • For personal support and queries, please submit a new issue to have it addressed.
  • For commercial related questions, please contact me for consulting costs.
🩷 Project support
If you found this project helpful, consider buying me a coffee
Thanks for your support, it is much appreciated!

About

A PowerShell launcher for common Google Workspace administration tasks driven by GAM. Designed around offboarding-style operations: archiving a user's mailbox into a group, moving their Drive content into a Shared Drive, transferring their calendars and event-organizer rights to another account, and managing mailbox delegation.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors