Added preview to updateprimaryemail <RegularExpression> <EmailReplacement> [preview]
Some checks failed
Build and test GAM / build (false, build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (false, build, 10, Build x86_64 macOS 15, macos-15-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 11, Build x86_64 macOS 26, macos-26-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 12, Build Arm MacOS 26, macos-26) (push) Has been cancelled
Build and test GAM / build (false, build, 13, Build Intel Windows, windows-2025-vs2026) (push) Has been cancelled
Build and test GAM / build (false, build, 14, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (false, build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (false, build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (false, test, 15, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (false, test, 16, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (false, test, 17, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (false, test, 18, Test Python 3.13, ubuntu-24.04, 3.13) (push) Has been cancelled
Build and test GAM / build (false, test, 19, Test Python 3.15-dev, ubuntu-24.04, 3.15-dev) (push) Has been cancelled
Build and test GAM / build (true, test, 20, Test Python 3.14 freethread, ubuntu-24.04, 3.14) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
Check for Google Root CA Updates / check-certs (push) Has been cancelled

This commit is contained in:
Ross Scroggs
2026-04-03 11:34:44 -07:00
parent 9c44a11a6a
commit ae6570823b
6 changed files with 40 additions and 20 deletions

View File

@@ -240,6 +240,7 @@ gam create cigroup <EmailAddress>
[security|makesecuritygroup] [locked] [security|makesecuritygroup] [locked]
[dynamic <QueryDynamicGroup>] [dynamic <QueryDynamicGroup>]
gam update cigroup <GroupEntity> [copyfrom <GroupItem>] <GroupAttribute> gam update cigroup <GroupEntity> [copyfrom <GroupItem>] <GroupAttribute>
[updateprimaryemail <RESearchPattern> <RESubstitution> [preview]]
[security|makesecuritygroup| [security|makesecuritygroup|
dynamicsecurity|makedynamicsecuritygroup| dynamicsecurity|makedynamicsecuritygroup|
lockedsecurity|makelockedsecuritygroup] lockedsecurity|makelockedsecuritygroup]
@@ -265,12 +266,15 @@ You can simply update a group's primary email address with the `email` option.
``` ```
gam update cigroup groupold@domain.com email groupnew@domain.com gam update cigroup groupold@domain.com email groupnew@domain.com
``` ```
The `updateprimaryemail <RESearchPattern> <RESubstitution>` option allows modification several group's The `updateprimaryemail <RESearchPattern> <RESubstitution> [preview]` option allows modification several group's
current primary email address. For example, to change the domain of a set of groups from the current domain.com to newdomain.com, current primary email address. For example, to change the domain of a set of groups from the current domain.com to newdomain.com,
make a CSV file Groups.csv with a column `email` that contains the group email addresses that are to be changed. make a CSV file Groups.csv with a column `email` that contains the group email addresses that are to be changed.
You can list all groups with: `gam redirect csv ./Groups.csv print cigroups`
``` ```
gam update cigroup csvfile Groups.csv:email updateprimaryemail "^(.+)@domain.com$" "\1@newdomain.com" gam update cigroup csvfile Groups.csv:email updateprimaryemail "^(.+)@domain.com$" "\1@newdomain.com"
``` ```
The `preview` option allows verification of the primary email address changes before commiting the changes.
If the group's current primary email address does not match the <REMatchPattern> then no modification is made. If the group's current primary email address does not match the <REMatchPattern> then no modification is made.
## Display information about individual groups ## Display information about individual groups

View File

@@ -10,6 +10,17 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
### 7.39.05
Added optional argument `preview` to `updateprimaryemail <RegularExpression> <EmailReplacement> [preview]`
for the following commands that causes GAM to preview, but not perform, primary email address changes.
This allows verification of the primary email address changes before commiting the changes.
```
gam update group <GroupEntity>
gam update cigroup <GroupEntity>
gam <UserTypeEntity> update user
```
### 7.39.04 ### 7.39.04
Added `updateprimaryemail <RegularExpression> <EmailReplacement>` option to Added `updateprimaryemail <RegularExpression> <EmailReplacement>` option to

View File

@@ -349,7 +349,7 @@ gam create group <EmailAddress>
[copyfrom <GroupItem>] <GroupAttribute>* [copyfrom <GroupItem>] <GroupAttribute>*
[verifynotinvitable] [verifynotinvitable]
gam update group|groups <GroupEntity> [email <EmailAddress>] gam update group|groups <GroupEntity> [email <EmailAddress>]
[updateprimaryemail <RESearchPattern> <RESubstitution>] [updateprimaryemail <RESearchPattern> <RESubstitution> [preview]]
[copyfrom <GroupItem>] <GroupAttribute>* [copyfrom <GroupItem>] <GroupAttribute>*
[makesecuritygroup|security] [makesecuritygroup|security]
[admincreated <Boolean>] [admincreated <Boolean>]
@@ -370,12 +370,15 @@ You can simply update a group's primary email address with the `email` option.
``` ```
gam update group groupold@domain.com email groupnew@domain.com gam update group groupold@domain.com email groupnew@domain.com
``` ```
The `updateprimaryemail <RESearchPattern> <RESubstitution>` option allows modification several group's The `updateprimaryemail <RESearchPattern> <RESubstitution> [preview]` option allows modification several group's
current primary email address. For example, to change the domain of a set of groups from the current domain.com to newdomain.com, current primary email address. For example, to change the domain of a set of groups from the current domain.com to newdomain.com,
make a CSV file Groups.csv with a column `email` that contains the group email addresses that are to be changed. make a CSV file Groups.csv with a column `email` that contains the group email addresses that are to be changed.
You can list all groups with: `gam redirect csv ./Groups.csv print groups`
``` ```
gam update group csvfile Groups.csv:email updateprimaryemail "^(.+)@domain.com$" "\1@newdomain.com" gam update group csvfile Groups.csv:email updateprimaryemail "^(.+)@domain.com$" "\1@newdomain.com"
``` ```
The `preview` option allows verification of the primary email address changes before commiting the changes.
If the group's current primary email address does not match the <REMatchPattern> then no modification is made. If the group's current primary email address does not match the <REMatchPattern> then no modification is made.
## Update a group's settings with JSON data ## Update a group's settings with JSON data

View File

@@ -251,10 +251,10 @@ writes the credentials into the file oauth2.txt.
``` ```
gamteam@server:/Users/gamteam$ rm -f /Users/gamteam/GAMConfig/oauth2.txt gamteam@server:/Users/gamteam$ rm -f /Users/gamteam/GAMConfig/oauth2.txt
gamteam@server:/Users/gamteam$ gam version gamteam@server:/Users/gamteam$ gam version
GAM 7.39.04 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.39.05 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.3 64-bit final
macOS Tahoe 26.3.1 arm64 macOS Tahoe 26.4 arm64
Path: /Users/gamteam/bin/gam7 Path: /Users/gamteam/bin/gam7
Config File: /Users/gamteam/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/gamteam/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
@@ -1034,7 +1034,7 @@ writes the credentials into the file oauth2.txt.
``` ```
C:\>del C:\GAMConfig\oauth2.txt C:\>del C:\GAMConfig\oauth2.txt
C:\>gam version C:\>gam version
GAM 7.39.04 - https://github.com/GAM-team/GAM - pythonsource GAM 7.39.05 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.3 64-bit final
Windows 11 10.0.26200 AMD64 Windows 11 10.0.26200 AMD64

View File

@@ -666,7 +666,7 @@ If the mailbox is setup, a zero return code is returned; if the retries are exha
``` ```
gam update user <UserItem> [ignorenullpassword] <UserAttribute>* gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
[verifynotinvitable|alwaysevict] [noactionifalias] [verifynotinvitable|alwaysevict] [noactionifalias]
[updateprimaryemail <RESearchPattern> <RESubstitution>] [updateprimaryemail <RESearchPattern> <RESubstitution> [preview]]
[updateoufromgroup <FileName> [charset <Charset>] [updateoufromgroup <FileName> [charset <Charset>]
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>] [columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]] [fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
@@ -688,7 +688,7 @@ gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
[logpassword <FileName>] [logpassword <FileName>]
gam update users <UserTypeEntity> [ignorenullpassword] <UserAttribute>* gam update users <UserTypeEntity> [ignorenullpassword] <UserAttribute>*
[verifynotinvitable|alwaysevict] [noactionifalias] [verifynotinvitable|alwaysevict] [noactionifalias]
[updateprimaryemail <RESearchPattern> <RESubstitution>] [updateprimaryemail <RESearchPattern> <RESubstitution> [preview]]
[updateoufromgroup <FileName> [charset <Charset>] [updateoufromgroup <FileName> [charset <Charset>]
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>] [columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]] [fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
@@ -709,7 +709,7 @@ gam update users <UserTypeEntity> [ignorenullpassword] <UserAttribute>*
[logpassword <FileName>] [logpassword <FileName>]
gam <UserTypeEntity> update users [ignorenullpassword] <UserAttribute>* gam <UserTypeEntity> update users [ignorenullpassword] <UserAttribute>*
[verifynotinvitable|alwaysevict] [noactionifalias] [verifynotinvitable|alwaysevict] [noactionifalias]
[updateprimaryemail <RESearchPattern>`< <RESubstitution>] [updateprimaryemail <RESearchPattern> <RESubstitution> [preview]]
[updateoufromgroup <FileName> [charset <Charset>] [updateoufromgroup <FileName> [charset <Charset>]
[columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>] [columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]
[fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]] [fields <FieldNameList>] [keyfield <FieldName>] [datafield <FieldName>]]
@@ -812,7 +812,7 @@ You can simply update a user's primary email address with the `primaryemail` opt
``` ```
gam update user userold@domain.com primaryemail usernew@domain.com gam update user userold@domain.com primaryemail usernew@domain.com
``` ```
The `updateprimaryemail <RESearchPattern> <RESubstitution>` option allows modification of the user's current primary email address. The `updateprimaryemail <RESearchPattern> <RESubstitution> [preview]` option allows modification of the user's current primary email address.
For example, to change the domain of a set of users from the current domain.com to newdomain.com: For example, to change the domain of a set of users from the current domain.com to newdomain.com:
``` ```
@@ -822,6 +822,8 @@ To change graduating students email addresses from flastname@domain.com to flast
``` ```
gam ou /Path/To/Ou update user updateprimaryemail "^(.+)@(.+)$" "\1_grad@\2" gam ou /Path/To/Ou update user updateprimaryemail "^(.+)@(.+)$" "\1_grad@\2"
``` ```
The `preview` option allows verification of the primary email address changes before commiting the changes.
If the user's current primary email address does not match the <REMatchPattern> then no modification is made. If the user's current primary email address does not match the <REMatchPattern> then no modification is made.
## Update a user's attributes with JSON data ## Update a user's attributes with JSON data

View File

@@ -3,10 +3,10 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAM 7.39.04 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.39.05 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.3 64-bit final
macOS Tahoe 26.3.1 arm64 macOS Tahoe 26.4 arm64
Path: /Users/gamteam/bin/gam7 Path: /Users/gamteam/bin/gam7
Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2026-02-15T07:51:00-08:00 Time: 2026-02-15T07:51:00-08:00
@@ -15,10 +15,10 @@ Time: 2026-02-15T07:51:00-08:00
Print the current version of Gam with details and time offset information Print the current version of Gam with details and time offset information
``` ```
gam version timeoffset gam version timeoffset
GAM 7.39.04 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.39.05 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.3 64-bit final
macOS Tahoe 26.3.1 arm64 macOS Tahoe 26.4 arm64
Path: /Users/gamteam/bin/gam7 Path: /Users/gamteam/bin/gam7
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Your system time differs from www.googleapis.com by less than 1 second Your system time differs from www.googleapis.com by less than 1 second
@@ -27,10 +27,10 @@ Your system time differs from www.googleapis.com by less than 1 second
Print the current version of Gam with extended details and SSL information Print the current version of Gam with extended details and SSL information
``` ```
gam version extended gam version extended
GAM 7.39.04 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.39.05 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.3 64-bit final
macOS Tahoe 26.3.1 arm64 macOS Tahoe 26.4 arm64
Path: /Users/gamteam/bin/gam7 Path: /Users/gamteam/bin/gam7
Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2026-02-15T07:51:00-08:00 Time: 2026-02-15T07:51:00-08:00
@@ -68,7 +68,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/gamteam/bin/gam7 Path: /Users/gamteam/bin/gam7
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 7.39.04 Latest: 7.39.05
echo $? echo $?
1 1
``` ```
@@ -76,7 +76,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
7.39.04 7.39.05
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@@ -86,10 +86,10 @@ echo $VER
Print the current version of Gam and address of this Wiki Print the current version of Gam and address of this Wiki
``` ```
gam help gam help
GAM 7.39.04 - https://github.com/GAM-team/GAM GAM 7.39.05 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.3 64-bit final
macOS Tahoe 26.3.1 arm64 macOS Tahoe 26.4 arm64
Path: /Users/gamteam/bin/gam7 Path: /Users/gamteam/bin/gam7
Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2026-02-15T07:51:00-08:00 Time: 2026-02-15T07:51:00-08:00