From 2ac6e361f0c70e34de4d7ab40eb920b39da0122f Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Fri, 31 Oct 2025 07:31:33 -0700 Subject: [PATCH] Added option `addcsvdata ` to `gam report [usage] customers|users` --- wiki/GamUpdates.md | 11 +++++++++ wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md | 4 ++-- wiki/Reports.md | 28 +++++++++++++++++++++++ wiki/Users-Drive-Permissions.md | 23 +++++++++++-------- wiki/Version-and-Help.md | 12 +++++----- 5 files changed, 60 insertions(+), 18 deletions(-) diff --git a/wiki/GamUpdates.md b/wiki/GamUpdates.md index 71e9bc3d..70f89440 100644 --- a/wiki/GamUpdates.md +++ b/wiki/GamUpdates.md @@ -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 +### 7.28.00 + +Added option `addcsvdata ` to `gam report [usage] customers|users` +that adds additional columns of data to the CSV file output. This will be most useful +when reading a CSV of user information and you want to include some of the user information, +e.g., orgUnitPath, in the output. +``` +gam redirect csv ./Users.csv print users fields ou +gam redirect csv ./UserStorageInfo.csv multiprocess csv Users.csv gam report users user "~primaryEmail" 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 addcsvdata orgUnitPath "~orgUnitPath" +``` + ### 7.27.05 Added option `addcsvdata ` to `gam print courses` diff --git a/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md b/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md index 68543f1c..8b2b8484 100644 --- a/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md +++ b/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md @@ -252,7 +252,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 -GAM 7.27.05 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.28.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.14.0 64-bit final macOS Tahoe 26.0.1 x86_64 @@ -990,7 +990,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 -GAM 7.27.05 - https://github.com/GAM-team/GAM - pythonsource +GAM 7.28.00 - https://github.com/GAM-team/GAM - pythonsource GAM Team Python 3.14.0 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/wiki/Reports.md b/wiki/Reports.md index 94518d4c..839fb835 100644 --- a/wiki/Reports.md +++ b/wiki/Reports.md @@ -213,6 +213,7 @@ gam report usage customer [todrive *] [skipdates [:](,[:])*] [skipdaysofweek (,)*] [fields|parameters ] [convertmbtogb] + (addcsvdata )* ``` Limit the time period. * `start ` - Default value is 30 days prior to `end ` @@ -224,6 +225,9 @@ Limit the time period. Option `convertmbtogb` causes GAM to convert parameters expressed in megabytes (name ends with _in_mb) to gigabytes (name converted to _in_gb) with two decimal places. +Add additional columns of data from the command line to the output. +* `addcsvdata ` + ### Example Jay provided this example. ``` @@ -267,6 +271,7 @@ gam report customers|customer|domain [todrive *] [(fields|parameters )|(services )] [noauthorizedapps] [convertmbtogb] + (addcsvdata )* ``` Specify the report date; the default is today's date. * `date ` - A single date; there is one API call @@ -279,6 +284,9 @@ Specify the report date; the default is today's date. Option `convertmbtogb` causes GAM to convert parameters expressed in megabytes (name ends with _in_mb) to gigabytes (name converted to _in_gb) with two decimal places. +Add additional columns of data from the command line to the output. +* `addcsvdata ` + If no report is available for the specified date, can an earlier date be used? * `limitdatechanges -1' - Back up to earlier dates to find report data; this is the default. * `limitdatechanges 0 | nodatechange' - Do not report on an earlier date if no report data is available for the specified date. @@ -332,6 +340,7 @@ gam report usage user [todrive] [skipdates [:](,[:])*] [skipdaysofweek (,)*] [fields|parameters ] [convertmbtogb] + (addcsvdata )* ``` Select the users for whom information is desired. * `user all` - All users, the default; there is one API call @@ -350,6 +359,9 @@ Limit the time period. Option `convertmbtogb` causes GAM to convert parameters expressed in megabytes (name ends with _in_mb) to gigabytes (name converted to _in_gb) with two decimal places. +Add additional columns of data from the command line to the output. +* `addcsvdata ` + ## User reports User reports are generally available up to four days before the current date. ``` @@ -374,6 +386,7 @@ gam report users|user [todrive *] [aggregatebydate|aggregatebyuser [Boolean]] [maxresults ] [convertmbtogb] + (addcsvdata )* ``` Select the users for whom information is desired. * `user all` - All users, the default; there is one API call @@ -396,6 +409,16 @@ Specify the report date; the default is today's date. Option `convertmbtogb` causes GAM to convert parameters expressed in megabytes (name ends with _in_mb) to gigabytes (name converted to _in_gb) with two decimal places. +Add additional columns of data from the command line to the output. +* `addcsvdata ` + +This will be most useful when reading a CSV of user information and you want to include some of the user information, +e.g., orgUnitPath, in the output. +``` +gam redirect csv ./Users.csv print users fields ou +gam redirect csv ./UserStorageInfo.csv multiprocess csv Users.csv gam report users user "~primaryEmail" 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 addcsvdata orgUnitPath "~orgUnitPath" +``` + If no report is available for the specified date, can an earlier date be used? * `limitdatechanges -1' - Back up to earlier dates to find report data; this is the default. * `limitdatechanges 0 | nodatechange' - Do not report on an earlier date if no report data is available for the specified date. @@ -452,6 +475,11 @@ 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 users total storage usage, include OrgUnitPath +``` +gam redirect csv ./Users.csv print users fields ou +gam redirect csv ./UserStorageInfo.csv multiprocess csv Users.csv gam report users user "~primaryEmail" 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 addcsvdata orgUnitPath "~orgUnitPath" +``` 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 2025-07-01 2025-07-07 diff --git a/wiki/Users-Drive-Permissions.md b/wiki/Users-Drive-Permissions.md index 2fc55fad..029daed9 100644 --- a/wiki/Users-Drive-Permissions.md +++ b/wiki/Users-Drive-Permissions.md @@ -117,25 +117,28 @@ specify `basicpermissions` and additional permission fields, e.g., `permissions. ::= "(,)*" ::= anyone|domain|group|user ::= "(,)*" - ::= - anyone|anyonewithlink| - user:|group:| - domain:|domainwithlink:; ::= anyone|anyonewithlink|id: ::= | - ::= - "(, ::= "(,)*" - ::= - | + ::= + | (json [charset ] )|(json file [charset ]) | | | | See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items - ::= - | + ::= + anyone; | + anyonewithlink; | + domain:; | + domainwithlink:; | + group:; | + user:; + ::= + "(, ::= + | (json [charset ] )|(json file [charset ]) | | | | See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items diff --git a/wiki/Version-and-Help.md b/wiki/Version-and-Help.md index b649ad21..dc3437f7 100644 --- a/wiki/Version-and-Help.md +++ b/wiki/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAM 7.27.05 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.28.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.14.0 64-bit final macOS Tahoe 26.0.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 -GAM 7.27.05 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.28.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.14.0 64-bit final macOS Tahoe 26.0.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 -GAM 7.27.05 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.28.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.14.0 64-bit final macOS Tahoe 26.0.1 x86_64 @@ -68,7 +68,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gam7 Version Check: Current: 5.35.08 - Latest: 7.27.05 + Latest: 7.28.00 echo $? 1 ``` @@ -76,7 +76,7 @@ echo $? Print the current version number without details ``` gam version simple -7.27.05 +7.28.00 ``` In Linux/MacOS you can do: ``` @@ -86,7 +86,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 7.27.05 - https://github.com/GAM-team/GAM +GAM 7.28.00 - https://github.com/GAM-team/GAM GAM Team Python 3.14.0 64-bit final macOS Tahoe 26.0.1 x86_64