diff --git a/docs/Find-File-Owner.md b/docs/Find-File-Owner.md index 53983f00..cd43b707 100644 --- a/docs/Find-File-Owner.md +++ b/docs/Find-File-Owner.md @@ -47,7 +47,7 @@ The `quotechar ` option allows you to choose an alternate quote chara ## Display File Ownership for Old files If the above commands fail, you can try to loop through all accounts, however this might take a long time if you are on a large Google Workspace Account. - +If any lines are displayed, the file owner is in the `owners.0.emailAddress` column. ``` gam config auto_batch_min 1 multiprocessexit rc=0 redirect csv - multiprocess redirect stderr null multiprocess all users print filelist select id fields id,name,owners.emailaddress norecursion showownedby any gam config auto_batch_min 1 multiprocessexit rc=0 redirect csv - multiprocess redirect stderr null multiprocess all users print filelist select name fields id,name,owners.emailaddress norecursion showownedby any diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 48861572..9be284e4 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,11 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 6.80.09 + +Added options `allschemas|(schemas|custom|customschemas )` to `gam print group-members` +that display any custom schema values for the group members. + ### 6.80.08 Updated `gam print|show oushareddrives` to display the Shared Drive ID, name and orgUnitPath as diff --git a/docs/Groups-Membership.md b/docs/Groups-Membership.md index ad75f0fc..e17dfcf3 100644 --- a/docs/Groups-Membership.md +++ b/docs/Groups-Membership.md @@ -597,6 +597,7 @@ gam print group-members [todrive *] [types ] [memberemaildisplaypattern|memberemailskippattern ] [userfields ] + [allschemas|(schemas|custom|customschemas )] [(recursive [noduplicates])|includederivedmembership] [nogroupemail] [peoplelookup|(peoplelookupuser )] [unknownname ] [cachememberinfo [Boolean]] @@ -661,7 +662,10 @@ these options specify which fields to display: * `*` - Individual field names * `fields ` - A comma separated list of field names * `delivery|deliverysettings` - Specify this field to get delivery information; an additional API call per member is required -* `userfields ` - For members that are users, display these user fields; an additional API call per member is required + +For members that are users, you can specify additional information to display; an additional API call per member is required +* `userfields ` - Display specific user fields +* `allschemas|(schemas|custom|customschemas )` - Display all or specific custom schema values The additional API calls can be reduced with the `cachememberinfo` option; a single API call is made for each user/group and the data is cached to eliminate to need to repeat the API call; this consumes more memory but dramatically reduces the number of API calls. diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 722b4393..ae0d202d 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin$ gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 6.80.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -923,7 +923,7 @@ writes the credentials into the file oauth2.txt. C:\>del C:\GAMConfig\oauth2.txt C:\>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.80.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Shared-Drives.md b/docs/Shared-Drives.md index 7e804fce..42a17648 100644 --- a/docs/Shared-Drives.md +++ b/docs/Shared-Drives.md @@ -441,6 +441,11 @@ When using the `formatjson` option, double quotes are used extensively in the da The `quotechar ` option allows you to choose an alternate quote character, single quote for instance, that makes for readable/processable output. `quotechar` defaults to `gam.cfg/csv_output_quote_char`. When uploading CSV files to Google, double quote `"` should be used. +### Get clean, simple output +``` +gam config csv_output_header_filter "driveId,driveName,orgUnitPath" print oushareddrives [ou ] +``` + ## Manage Shared Drive access These commands are used to manage the ACLs on Shared Drives themselves, not the files/folders on the Shared Drives. diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index eeb2d468..bf11830f 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.80.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 6.80.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -27,7 +27,7 @@ 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 ``` gam version extended -GAMADV-XTD3 6.80.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.80.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.80.08 + Latest: 6.80.09 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.80.08 +6.80.09 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.80.08 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.80.09 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 39f8b793..506d56ab 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -3813,6 +3813,7 @@ gam print group-members [todrive *] [types ] [memberemaildisplaypattern|memberemailskippattern ] [userfields ] + [allschemas|(schemas|custom|customschemas )] [(recursive [noduplicates])|includederivedmembership] [nogroupemail] [peoplelookup|(peoplelookupuser )] [unknownname ] [cachememberinfo [Boolean]] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index a6dc6422..0c35ab2f 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,11 @@ Merged GAM-Team version +6.80.09 + +Added options `allschemas|(schemas|custom|customschemas )` to `gam print group-members` +that display any custom schema values for the group members. + 6.80.08 Updated `gam print|show oushareddrives` to display the Shared Drive ID, name and orgUnitPath as diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 22da1dac..5bf169c9 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -33134,6 +33134,7 @@ GROUPMEMBERS_DEFAULT_FIELDS = ['group', 'type', 'role', 'id', 'status', 'email'] # [membernames] [showdeliverysettings] # * [fields ] # [userfields ] +# [allschemas|(schemas|custom|customschemas )] # [(recursive [noduplicates])|includederivedmembership] [nogroupemail] # [peoplelookup|(peoplelookupuser )] # [unknownname ] [cachememberinfo [Boolean]] @@ -33169,6 +33170,7 @@ def doPrintGroupMembers(): showOwnedBy = {} cdfieldsList = ['email'] userFieldsList = [] + schemaParms = _initSchemaParms('basic') rolesSet = set() typesSet = set() matchPatterns = {} @@ -33217,6 +33219,12 @@ def doPrintGroupMembers(): csvPF.AddField(field, USER_FIELDS_CHOICE_MAP, userFieldsList) else: invalidChoiceExit(field, USER_FIELDS_CHOICE_MAP, True) + elif myarg in {'allschemas', 'custom', 'schemas', 'customschemas'}: + if myarg == 'allschemas': + schemaParms = _initSchemaParms('full') + else: + _getSchemaNameList(schemaParms) + userFieldsList.append('customSchemas') elif myarg == 'noduplicates': memberOptions[MEMBEROPTION_NODUPLICATES] = True elif myarg == 'recursive': @@ -33318,7 +33326,8 @@ def doPrintGroupMembers(): mbinfo = callGAPI(cd.users(), 'get', throwReasons=GAPI.USER_GET_THROW_REASONS+[GAPI.SERVICE_NOT_AVAILABLE, GAPI.FAILED_PRECONDITION], retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS, - userKey=memberId, fields=userFields) + userKey=memberId, projection=schemaParms['projection'], customFieldMask=schemaParms['customFieldMask'], + fields=userFields) if memberOptions[MEMBEROPTION_MEMBERNAMES]: row['name'] = mbinfo['name'].pop('fullName') if not mbinfo['name']: @@ -43296,12 +43305,12 @@ def infoUsers(entityList): elif myarg == 'noschemas': getSchemas = False schemaParms = _initSchemaParms('basic') - elif myarg == 'allschemas': + elif myarg in {'allschemas', 'custom', 'schemas', 'customschemas'}: + if myarg == 'allschemas': + schemaParms = _initSchemaParms('full') + else: + _getSchemaNameList(schemaParms) getSchemas = True - schemaParms = _initSchemaParms('full') - elif myarg in {'custom', 'schemas', 'customschemas'}: - getSchemas = True - _getSchemaNameList(schemaParms) elif myarg in {'products', 'product'}: skus = SKU.convertProductListToSKUList(getGoogleProductList()) elif myarg in {'sku', 'skus'}: