Library / Google Workspace

GWS-004 · Script

User Provisioning and Profile Updates

Creates new Google Workspace users and updates existing users' profiles from a CSV.

Version 1.0.0Language PowerShellUpdated November 2026

What it does

For each row, creates the user if the account does not exist, or updates the profile fields you provide if it does. Blank cells are left unchanged on existing users. Any column named like SchemaName.FieldName is written as a custom attribute. New accounts get the password from the CSV or a strong random one, and must change it at first sign-in. Passwords are never written to the log. Preview mode (default) shows every change without making it.

Requirements

GAM7, installed and authorized by you. GAM is not included. Windows PowerShell 5.1 or PowerShell 7.

How to run it

  • Run from: an admin workstation or scheduled task with GAM7 set up
  • This is an admin script for your Google Workspace tenant, not a per-device endpoint script
  • User interaction: none with app-only sign-in
  • Schedule: run on demand, or weekly for reports

Settings

NameWhat it doesOptionsDefault
ModePreview = show changes only (default). Apply = make the changes.Preview, ApplyPreview
InputCsvCSV with columns: Email, FirstName, LastName, and optional OrgUnitPath, Password, Title, Department, EmployeeId, plus any SchemaName.FieldName columns.required
DefaultOrgUnitOU for new users when the row has no OrgUnitPath. Default: //
ExportNewPasswordsSave new accounts and their starting passwords to a CSV in the Reports folder. Store or delete that file securely after use.False
GamPathPath to GAM. Default: gam (on PATH).gam

Exit codes

  • 0 = Completed, nothing needs attention
  • 1 = Completed, but some rows failed
  • 2 = Script error (see log)

Testing steps

  1. Run it first with the mode set to Preview on one test account or small group. Nothing is changed in that mode.
  2. Read the log and confirm the planned changes are what you expect.
  3. Run your chosen settings on the same test target and confirm the result.
  4. Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
  5. Roll out to a small group next, then everyone.

Rollback steps

Preview mode changes nothing. New accounts can be suspended or deleted. Profile changes can be reversed by running again with the old values; export users with GWS-009 first.

Version and change log

VersionDateChanges
1.0.0November 2026First release.