From f6b949e4c10c9264a493cbb28cd29828df784379 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 31 May 2024 20:47:00 -0700 Subject: [PATCH] Updated `gam print filelist ... showshareddrivepermissions` --- docs/GamUpdates.md | 6 ++++++ docs/How-to-Upgrade-from-Standard-GAM.md | 4 ++-- docs/Licenses.md | 4 ++++ docs/Reports.md | 3 ++- docs/Reseller.md | 4 +++- docs/Version-and-Help.md | 12 ++++++------ src/GamCommands.txt | 7 +++++-- src/GamUpdate.txt | 6 ++++++ src/gam/__init__.py | 7 +++++++ 9 files changed, 41 insertions(+), 12 deletions(-) diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 51bbeda8..cd0334fd 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,12 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation +### 6.76.11 + +Updated `gam print filelist ... showshareddrivepermissions` to display +progress messages to stderr as a separate API call must be made for every file/folder on the Shared Drive +to get its permissions. As this can take a long time, the progress messages indicate that progress is being made. + ### 6.76.10 Added `fromgmail` to `` that can be used in `gam calendars print|show events ... eventtype fromgmail`. diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 10a937c2..b333d5a6 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -335,7 +335,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ ./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.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.3 64-bit final MacOS Sonoma 14.4.1 x86_64 @@ -1009,7 +1009,7 @@ writes the credentials into the file oauth2.txt. C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.3 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Licenses.md b/docs/Licenses.md index a0cb4ad6..89cb40f0 100644 --- a/docs/Licenses.md +++ b/docs/Licenses.md @@ -39,6 +39,8 @@ | License Name | License SKU | Abbreviation | |--------------|-------------|---------------| +| AI Meetings and Messaging | 1010470007 | aimeetingsandmessaging | +| AI Security | 1010470006 | aisecurity | | AppSheet Core | 1010380001 | appsheetcore | | AppSheet Enterprise Standard | 1010380002 | appsheetstandard | | AppSheet Enterprise Plus | 1010380003 | appsheetplus | @@ -136,6 +138,8 @@ 4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB | 8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB | 16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB | + aimeetingsandmessaging | 1010470007 | AI Meetings and Messaging | + aisecurity | 1010470006 | AI Security | appsheetcore | 1010380001 | AppSheet Core | appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard | appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus | diff --git a/docs/Reports.md b/docs/Reports.md index e05d7fca..a8333c57 100644 --- a/docs/Reports.md +++ b/docs/Reports.md @@ -49,7 +49,8 @@ rules| saml| token|tokens|oauthtoken| - useraccounts + useraccounts| + vault gam report [todrive *] [(user all|)|(orgunit|org|ou [showorgunit])|(select )] diff --git a/docs/Reseller.md b/docs/Reseller.md index 6c717994..8022c4fb 100644 --- a/docs/Reseller.md +++ b/docs/Reseller.md @@ -59,11 +59,13 @@ Thanks to Duncan Isaksen-Loxton for a script to help manage multiple domains. 4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB | 8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB | 16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB | + aimeetingsandmessaging | 1010470007 | AI Meetings and Messaging | + aisecurity | 1010470006 | AI Security | appsheetcore | 1010380001 | AppSheet Core | appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard | appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus | assuredcontrols | 1010390001 | Assured Controls | - bce | beyondcorp | beyondcorpenterprise | 1010400001 | Beyond Corp Enterprise | + bce | beyondcorp | beyondcorpenterprise | cep | chromeenterprisepremium | 1010400001 | Chrome Enterprise Premium | cdm | chrome | googlechromedevicemanagement | Google-Chrome-Device-Management | cloudidentity | identity | 1010010001 | Cloud Identity | cloudidentitypremium | identitypremium | 1010050001 | Cloud Identity Premium | diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 192d75ec..53ea254a 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.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.3 64-bit final MacOS Sonoma 14.4.1 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.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.3 64-bit final MacOS Sonoma 14.4.1 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.76.10 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.3 64-bit final MacOS Sonoma 14.4.1 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.76.10 + Latest: 6.76.11 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.76.10 +6.76.11 ``` 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.76.10 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.76.11 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.3 64-bit final MacOS Sonoma 14.4.1 x86_64 diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 6c1c0a32..51e5fa18 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -259,6 +259,8 @@ If an item contains spaces, it should be surrounded by ". 4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB | 8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB | 16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB | + aimeetingsandmessaging | 1010470007 | AI Meetings and Messaging | + aisecurity | 1010470006 | AI Security | appsheetcore | 1010380001 | AppSheet Core | appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard | appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus | @@ -1580,6 +1582,7 @@ gam calendar printacl [todrive *] ::= default| focustime| + fromgmail| outofoffice| workinglocation ::= "(,)*" @@ -5349,7 +5352,7 @@ gam update user [ignorenullpassword] * [columndelimiter ] [noescapechar ] [quotechar ] [fields ] [keyfield ] [datafield ]] [immutableous ]| - [clearschema | ] + [clearschema |] [createifnotfound] [notfoundpassword (random [])|blocklogin|] (groups [] [[delivery] ] )* [alias|aliases ] @@ -5417,7 +5420,7 @@ gam update users [ignorenullpassword] * [verifynotinvitable] [noactionifalias] [updateprimaryemail ] [updateoufromgroup [keyfield ] [datafield ]] - [clearschema | ] + [clearschema |] [createifnotfound] [notfoundpassword (random [])|blocklogin|] (groups [] [[delivery] ] )* [alias|aliases ] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index d554aad5..b10e961d 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,12 @@ Merged GAM-Team version +6.76.11 + +Updated `gam print filelist ... showshareddrivepermissions` to display +progress messages to stderr as a separate API call must be made for every file/folder on the Shared Drive +to get its permissions. As this can take a long time, the progress messages indicate that progress is being made. + 6.76.10 Added `fromgmail` to `` that can be used in `gam calendars print|show events ... eventtype fromgmail`. diff --git a/src/gam/__init__.py b/src/gam/__init__.py index d3f039c2..589b650a 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -53776,6 +53776,7 @@ def printFileList(users): csvPF.WriteRowTitlesJSONNoFilter(row) def _printFileInfo(drive, user, f_file, cleanFileName): + nonlocal getSharedDriveACLsCount, getSharedDriveACLsCountMsg driveId = f_file.get('driveId') checkSharedDrivePermissions = getPermissionsForSharedDrives and driveId and 'permissions' not in f_file if (f_file.get('noDisplay', False) or @@ -53789,6 +53790,10 @@ def printFileList(users): (DLP.onlySharedDrives and not driveId)): return if checkSharedDrivePermissions: + if not incrementalPrint: + getSharedDriveACLsCount += 1 + if getSharedDriveACLsCount % 100 == 0: + writeStderr(f'{Msg.GOT} {getSharedDriveACLsCount} {getSharedDriveACLsCountMsg}') try: f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, @@ -54053,6 +54058,7 @@ def printFileList(users): elif myarg == 'showshareddrivepermissions': getPermissionsForSharedDrives = True permissionsFields = f'nextPageToken,permissions({",".join(DRIVEFILE_BASIC_PERMISSION_FIELDS)})' + getSharedDriveACLsCountMsg = f'{Ent.Plural(Ent.DRIVE_FILE_OR_FOLDER_ACL)} {Msg.FOR} {Ent.Plural(Ent.SHAREDDRIVE)}\n' elif myarg == 'pmfilter': pmselect = False elif myarg == 'oneitemperrow': @@ -54198,6 +54204,7 @@ def printFileList(users): filePathInfo = initFilePathInfo(pathDelimiter) filesPrinted = set() mimeTypeInfo = {} + getSharedDriveACLsCount = 0 if buildTree: printGettingAllEntityItemsForWhom(Ent.DRIVE_FILE_OR_FOLDER, user, i, count, query=DLP.fileIdEntity['query']) if not incrementalPrint: