Fixed bug in `gam <UserTypeEntity> print|show filesharecounts

This commit is contained in:
Ross Scroggs
2024-06-12 20:57:36 -07:00
parent 6d25ada6a4
commit 12c150f64d
10 changed files with 32 additions and 25 deletions

View File

@ -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 See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
### 6.76.15
Fixed bug in `gam <UserTypeEntity> print|show filesharecounts summary only summaryuser <String>`
that printed an erroneous row if `<UserTypeEntity>` specified a single user and `<String>` matched
the user's email address.
### 6.76.14 ### 6.76.14
Added the following Gemini License SKUs: Added the following Gemini License SKUs:

View File

@ -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$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version 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 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.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.76.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64 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>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.76.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.76.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final Python 3.12.3 64-bit final
Windows-10-10.0.17134 AMD64 Windows-10-10.0.17134 AMD64

View File

@ -10,7 +10,8 @@ Thank you.
* Goldy Arora - https://www.goldyarora.com/license-notifier/ * Goldy Arora - https://www.goldyarora.com/license-notifier/
* Iain Macleod - https://docs.google.com/document/d/1QxWAPdhROcx70OXLpSD9Trh3vs-nJKSMiaMZCTwOOTg/edit?pli=1#heading=h.2a2azzpy36k0 * Iain Macleod - https://docs.google.com/document/d/1QxWAPdhROcx70OXLpSD9Trh3vs-nJKSMiaMZCTwOOTg/edit?pli=1#heading=h.2a2azzpy36k0
* James Seymour - https://sites.google.com/jis.edu.bn/gam-commands/home * James Seymour - https://sites.google.com/jis.edu.bn/gam-commands/home
* Kevin Melillo - https://github.com/KevinMelilloIEEE/gam-script * Kevin Melillo - https://github.com/KevinMelilloIEEE/gam-script
* Korey Rideout - https://chatgpt.com/g/g-PTxxnVPMG-gam-assist - A helpful tool to assist with, GAM (+Advance) and GYB commands to assist with syntax for Google Workspace Administrators.
* Paul Ogier (Taming.Tech) - GAMADV-XTD3 Course on Udemy https://taming.tech/GAMCourse * Paul Ogier (Taming.Tech) - GAMADV-XTD3 Course on Udemy https://taming.tech/GAMCourse
* Paul Ogier (Taming.Tech) - GAMADV-XTD3 Tutorials https://www.youtube.com/watch?v=g9LDeyXQNLI&list=PL_dLiK09pJVhKJxZHNk9CHK0q5hkZ856w * Paul Ogier (Taming.Tech) - GAMADV-XTD3 Tutorials https://www.youtube.com/watch?v=g9LDeyXQNLI&list=PL_dLiK09pJVhKJxZHNk9CHK0q5hkZ856w
* Paul Ogier (Taming.Tech) - https://taming.tech/taming-gam-a-practical-guide-to-gam-and-gamadv-xtd3/ * Paul Ogier (Taming.Tech) - https://taming.tech/taming-gam-a-practical-guide-to-gam-and-gamadv-xtd3/

View File

@ -391,6 +391,10 @@ Report on users Google Drive usage.
``` ```
gam report users parameters accounts:drive_used_quota_in_mb,accounts:total_quota_in_mb,accounts:used_quota_in_mb,accounts:used_quota_in_percentage gam report users parameters accounts:drive_used_quota_in_mb,accounts:total_quota_in_mb,accounts:used_quota_in_mb,accounts:used_quota_in_percentage
``` ```
Report on users total storage usage.
```
gam report users parameters accounts:drive_used_quota_in_mb,accounts:gmail_used_quota_in_mb,accounts:gplus_photos_used_quota_in_mb,accounts:total_quota_in_mb,accounts:used_quota_in_mb,accounts:used_quota_in_percentage
```
Report on email activity for individual users. Report on email activity for individual users.
``` ```
$ gam report users select users testuser1,testuser2,testuser3 fields gmail:num_emails_received,gmail:num_emails_sent range 2023-07-01 2023-07-07 $ gam report users select users testuser1,testuser2,testuser3 fields gmail:num_emails_received,gmail:num_emails_sent range 2023-07-01 2023-07-07

View File

@ -244,7 +244,7 @@ gam <UserTypeEntity> draft message
* `file|htmlfile <FileName> [charset <Charset>]` - Read the message from `<FileName>` * `file|htmlfile <FileName> [charset <Charset>]` - Read the message from `<FileName>`
* `gdoc|ghtml <UserGoogleDoc>` - Read the message from `<UserGoogleDoc>` * `gdoc|ghtml <UserGoogleDoc>` - Read the message from `<UserGoogleDoc>`
* `gcsdoc|gcshtml <StorageBucketObjectName>` - Read the message from the Google Cloud Storage file `<StorageBucketObjectName>` * `gcsdoc|gcshtml <StorageBucketObjectName>` - Read the message from the Google Cloud Storage file `<StorageBucketObjectName>`
* `emlfile <FileName> [charset <Charset>]` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message file. The default `chatser` is `ascii`. * `emlfile <FileName> [charset <Charset>]` - Read the message from the EML message file `<FileName>`. SMTP headers specified in the command will replace those in the message file. The default `charset` is `ascii`.
The `<SMTPDateHeader> <Time>` argument requires `<Time>` values which will be converted to RFC2822 dates. If you have these headers with values that The `<SMTPDateHeader> <Time>` argument requires `<Time>` values which will be converted to RFC2822 dates. If you have these headers with values that
are not in `<Time>` format, use the argument `header <SMTPDateHeader> <String>`. are not in `<Time>` format, use the argument `header <SMTPDateHeader> <String>`.
@ -261,7 +261,7 @@ Your HTML message will contain lines like this:
<img src="cid:image2"/> <img src="cid:image2"/>
``` ```
Your command line will have: `embedimage file1.jpg image1` embedimage file2.jpg image2` Your command line will have: `embedimage file1.jpg image1 embedimage file2.jpg image2`
## Import messages ## Import messages
Import a message into a user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Import a message into a user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP.

View File

@ -3,7 +3,7 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAMADV-XTD3 6.76.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.76.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64 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 Print the current version of Gam with details and time offset information
``` ```
gam version timeoffset gam version timeoffset
GAMADV-XTD3 6.76.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.76.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64 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 Print the current version of Gam with extended details and SSL information
``` ```
gam version extended gam version extended
GAMADV-XTD3 6.76.14 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.76.15 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64 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 Path: /Users/Admin/bin/gamadv-xtd3
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 6.76.14 Latest: 6.76.15
echo $? echo $?
1 1
``` ```
@ -72,7 +72,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
6.76.14 6.76.15
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@ -82,7 +82,7 @@ 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 6.76.14 - https://github.com/taers232c/GAMADV-XTD3 GAM 6.76.15 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.3 64-bit final Python 3.12.3 64-bit final
MacOS Sonoma 14.4.1 x86_64 MacOS Sonoma 14.4.1 x86_64

View File

@ -2,18 +2,11 @@
Merged GAM-Team version Merged GAM-Team version
6.77.00 6.76.15
Added option `asadmin` to the following Chat commands that allows admin access. Fixed bug in `gam <UserTypeEntity> print|show filesharecounts summary only summaryuser <String>`
These commands are in Developer Preview, your project must have Developer Preview enabled for the Chat API that printed an erroneous row if `<UserTypeEntity>` specified a single user and `<String>` matched
in order to use these commands. the user's email address.
```
gam <UserTypeEntity> delete chatspace asadmin
gam <UserTypeEntity> print|show chatspaces asadmin
gam <UserTypeEntity> create chatmember asadmin
gam <UserTypeEntity> delete|remove chatmember asadmin
gam <UserTypeEntity> print|show chatmembers|asadmin
```
6.76.14 6.76.14

View File

@ -30278,7 +30278,7 @@ def doCreateGroup(ciGroupsAPI=False):
callGAPI(gs.groups(), 'update', callGAPI(gs.groups(), 'update',
bailOnInvalidError='messageModerationLevel' in settings, bailOnInvalidError='messageModerationLevel' in settings,
throwReasons=GAPI.GROUP_SETTINGS_THROW_REASONS, throwReasons=GAPI.GROUP_SETTINGS_THROW_REASONS,
retryReasons=GAPI.GROUP_SETTINGS_RETRY_REASONS+[GAPI.NOT_FOUND,GAPI.INVALID_ARGUMENT], retryReasons=GAPI.GROUP_SETTINGS_RETRY_REASONS+[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT],
groupUniqueId=mapGroupEmailForSettings(groupEmail), body=settings, fields='') groupUniqueId=mapGroupEmailForSettings(groupEmail), body=settings, fields='')
entityActionPerformed([entityType, groupEmail]) entityActionPerformed([entityType, groupEmail])
except (GAPI.alreadyExists, GAPI.duplicate): except (GAPI.alreadyExists, GAPI.duplicate):
@ -54853,7 +54853,7 @@ def printShowFileCounts(users):
def showMimeTypeInfo(user, mimeTypeInfo, sharedDriveId, sharedDriveName, i, count): def showMimeTypeInfo(user, mimeTypeInfo, sharedDriveId, sharedDriveName, i, count):
if summary != FILECOUNT_SUMMARY_NONE: if summary != FILECOUNT_SUMMARY_NONE:
if user != summaryUser: if count != 0:
for mimeType, mtinfo in iter(mimeTypeInfo.items()): for mimeType, mtinfo in iter(mimeTypeInfo.items()):
summaryMimeTypeInfo.setdefault(mimeType, {'count': 0, 'size': 0}) summaryMimeTypeInfo.setdefault(mimeType, {'count': 0, 'size': 0})
summaryMimeTypeInfo[mimeType]['count'] += mtinfo['count'] summaryMimeTypeInfo[mimeType]['count'] += mtinfo['count']
@ -55264,7 +55264,7 @@ def printShowFileShareCounts(users):
def showShareCounts(user, shareCounts, i, count): def showShareCounts(user, shareCounts, i, count):
if summary != FILECOUNT_SUMMARY_NONE: if summary != FILECOUNT_SUMMARY_NONE:
if user != summaryUser: if count != 0:
for field, shareCount in iter(shareCounts.items()): for field, shareCount in iter(shareCounts.items()):
summaryShareCounts[field] += shareCount summaryShareCounts[field] += shareCount
if summary == FILECOUNT_SUMMARY_ONLY: if summary == FILECOUNT_SUMMARY_ONLY:

View File

@ -84,6 +84,7 @@ class GamEntity():
CHANNEL_PRODUCT = 'chpr' CHANNEL_PRODUCT = 'chpr'
CHANNEL_SKU = 'chsk' CHANNEL_SKU = 'chsk'
CHAT_BOT = 'chbo' CHAT_BOT = 'chbo'
CHAT_ADMIN = 'chad'
CHAT_EVENT = 'chev' CHAT_EVENT = 'chev'
CHAT_MANAGER_USER = 'chgu' CHAT_MANAGER_USER = 'chgu'
CHAT_MEMBER = 'chme' CHAT_MEMBER = 'chme'
@ -424,6 +425,7 @@ class GamEntity():
CHANNEL_PRODUCT: ['Channel Products', 'Channel Product'], CHANNEL_PRODUCT: ['Channel Products', 'Channel Product'],
CHANNEL_SKU: ['Channel SKUs', 'Channel SKU'], CHANNEL_SKU: ['Channel SKUs', 'Channel SKU'],
CHAT_BOT: ['Chat BOTs', 'Chat BOT'], CHAT_BOT: ['Chat BOTs', 'Chat BOT'],
CHAT_ADMIN: ['Chat Admins', 'Chat Admin'],
CHAT_EVENT: ['Chat Events', 'Chat Event'], CHAT_EVENT: ['Chat Events', 'Chat Event'],
CHAT_MANAGER_USER: ['Chat User Managers', 'Chat User Manager'], CHAT_MANAGER_USER: ['Chat User Managers', 'Chat User Manager'],
CHAT_MESSAGE: ['Chat Messages', 'Chat Message'], CHAT_MESSAGE: ['Chat Messages', 'Chat Message'],

View File

@ -186,6 +186,7 @@ BATCH_NOT_PROCESSED_ERRORS = '{0}batch file: {1}, not processed, {2} {3}\n'
CALLING_GCLOUD_FOR_REAUTH = 'Calling gcloud for reauth credentials..."\n' CALLING_GCLOUD_FOR_REAUTH = 'Calling gcloud for reauth credentials..."\n'
CAN_NOT_DELETE_USER_WITH_VAULT_HOLD = '{0}: The user may be (or have recently been) on Google Vault Hold and thus not eligible for deletion. You can check holds with "gam user {1} show vaultholds".' CAN_NOT_DELETE_USER_WITH_VAULT_HOLD = '{0}: The user may be (or have recently been) on Google Vault Hold and thus not eligible for deletion. You can check holds with "gam user {1} show vaultholds".'
CAN_NOT_BE_SPECIFIED_MORE_THAN_ONCE = 'Argument {0} can not be specified more than once' CAN_NOT_BE_SPECIFIED_MORE_THAN_ONCE = 'Argument {0} can not be specified more than once'
CHAT_ADMIN_ACCESS_LIMITED_TO_ONE_USER = 'Chat adminaccess|asadmin limited to one user, {0} specified'
CHROME_TARGET_VERSION_FORMAT = r'^([a-z]+)-(\d+)$ or ^(\d{1,4}\.){1,4}$' CHROME_TARGET_VERSION_FORMAT = r'^([a-z]+)-(\d+)$ or ^(\d{1,4}\.){1,4}$'
COLUMN_DOES_NOT_MATCH_ANY_INPUT_COLUMNS = '{0} column "{1}" does not match any input columns' COLUMN_DOES_NOT_MATCH_ANY_INPUT_COLUMNS = '{0} column "{1}" does not match any input columns'
COLUMN_DOES_NOT_MATCH_ANY_OUTPUT_COLUMNS = '{0} column "{1}" does not match any output columns' COLUMN_DOES_NOT_MATCH_ANY_OUTPUT_COLUMNS = '{0} column "{1}" does not match any output columns'