From 1243ece157654b2a9f9a4770a6e424f537d545f6 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 18 Aug 2023 11:37:55 -0700 Subject: [PATCH] Use writeStdout so redirect stdout catches data; update documentation --- src/GamCommands.txt | 4 ++-- src/GamUpdate.txt | 12 ++++++++++++ src/gam/__init__.py | 7 ++++--- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/GamCommands.txt b/src/GamCommands.txt index e204343e..18165bed 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -5135,7 +5135,7 @@ gam download storagefile gam create|add user [ignorenullpassword] * - [verifynotinvitable] + [verifynotinvitable|alwaysevict] (groups [] [[delivery] ] )* [alias|aliases ] [license [product|productid ]] @@ -5152,7 +5152,7 @@ gam create|add user [ignorenullpassword] * gam waitformailbox [retries ] gam update user [ignorenullpassword] * - [verifynotinvitable] [noactionifalias] + [verifynotinvitable|alwaysevict] [noactionifalias] [updateprimaryemail ] [updateoufromgroup [charset ] [columndelimiter ] [quotechar ] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 1e6d2369..4ed6a7bd 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,18 @@ Merged GAM-Team version +6.63.01 + +Following Jay's lead, added option `alwaysevict` to `gam create|update user` that is used to specify GAM's +behavior when `verifynotinvitable` is not specified and there is a conflict with an unmanaged account. + +By default, when creating a user that has a conflict with an unmanaged account, GAM will honor the setting on this page: + * https://admin.google.com/ac/accountsettings/conflictaccountmanagement + +Specifying `alwaysevict` forces GAM to select this setting: `Replace conflicting unmanaged accounts with managed ones` + +With `gam update user`, `alwaysevict` only applies if `createifnotfound` is specified and the user was not found to update and must be created. + 6.63.00 Added support for calendar working location events. diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 89157145..5a691807 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -12222,7 +12222,7 @@ def doCreateGCPServiceAccount(): systemErrorExit(API_ACCESS_DENIED_RC, str(e)) sa_info['client_id'] = token_info['issued_to'] sa_output = json.dumps(sa_info, ensure_ascii=False, sort_keys=True, indent=2) - print(f'Writing SignJWT service account data:\n\n{sa_output}') + writeStdout(f'Writing SignJWT service account data:\n\n{sa_output}\n') writeFile(GC.Values[GC.OAUTH2SERVICE_JSON], sa_output, continueOnError=False) # Audit command utilities @@ -40366,6 +40366,7 @@ def createUserAddAliases(cd, user, aliasList, i, count): Act.Set(action) # gam create user +# [verifynotinvitable|alwaysevict] # (groups [] [[delivery] ] )* # [alias|aliases ] # [license [product|productid ]] @@ -40463,7 +40464,8 @@ def verifyUserPrimaryEmail(cd, user, createIfNotFound, i, count): entityUnknownWarning(Ent.USER, user, i, count) return False -# gam update user * [noactionifalias] +# gam update user * +# [verifynotinvitable|alwaysevict] [noactionifalias] # [updateprimaryemail ] # [updateoufromgroup [keyfield ] [datafield ]] # [immutableous ]| @@ -40480,7 +40482,6 @@ def verifyUserPrimaryEmail(cd, user, createIfNotFound, i, count): # (replace )*] # [notifyonupdate []] # [lograndompassword ] [ignorenullpassword] -# [verifynotinvitable] def updateUsers(entityList): cd = buildGAPIObject(API.DIRECTORY) ci = None