Compare commits

...

7 Commits

Author SHA1 Message Date
Ross Scroggs
e79747bc55 Added command gam show configlicenseskus #1938
Some checks are pending
Build and test GAM / build (false, build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Waiting to run
Build and test GAM / build (false, build, 10, Build x86_64 macOS 15, macos-15-intel) (push) Waiting to run
Build and test GAM / build (false, build, 11, Build x86_64 macOS 26, macos-26-intel) (push) Waiting to run
Build and test GAM / build (false, build, 12, Build Arm MacOS 26, macos-26) (push) Waiting to run
Build and test GAM / build (false, build, 13, Build Intel Windows, windows-2025-vs2026) (push) Waiting to run
Build and test GAM / build (false, build, 14, Build Arm Windows, windows-11-arm) (push) Waiting to run
Build and test GAM / build (false, build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Waiting to run
Build and test GAM / build (false, build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Waiting to run
Build and test GAM / build (false, build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Waiting to run
Build and test GAM / build (false, build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Waiting to run
Build and test GAM / build (false, build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Waiting to run
Build and test GAM / build (false, build, 8, Build Arm MacOS 14, macos-14) (push) Waiting to run
Build and test GAM / build (false, build, 9, Build Arm MacOS 15, macos-15) (push) Waiting to run
Build and test GAM / build (false, test, 15, Test Python 3.10, ubuntu-24.04, 3.10) (push) Waiting to run
Build and test GAM / build (false, test, 16, Test Python 3.11, ubuntu-24.04, 3.11) (push) Waiting to run
Build and test GAM / build (false, test, 17, Test Python 3.12, ubuntu-24.04, 3.12) (push) Waiting to run
Build and test GAM / build (false, test, 18, Test Python 3.13, ubuntu-24.04, 3.13) (push) Waiting to run
Build and test GAM / build (false, test, 19, Test Python 3.15-dev, ubuntu-24.04, 3.15-dev) (push) Waiting to run
Build and test GAM / build (true, test, 20, Test Python 3.14 freethread, ubuntu-24.04, 3.14) (push) Waiting to run
Build and test GAM / publish (push) Blocked by required conditions
CodeQL / Analyze (python) (push) Waiting to run
Push wiki / pushwiki (push) Waiting to run
2026-07-04 09:52:28 -07:00
Ross Scroggs
1df2f14c97 Added command gam show configlicenseskus #1938 2026-07-04 08:59:53 -07:00
Ross Scroggs
2fbc3c5c35 Suppress Regional Access Boundary HTTP message
Some checks failed
Push wiki / pushwiki (push) Has been cancelled
2026-07-02 13:18:07 -07:00
Ross Scroggs
6336563071 Suppress Regional Access Boundary HTTP message
Some checks failed
Push wiki / pushwiki (push) Has been cancelled
Build and test GAM / build (false, build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (false, build, 10, Build x86_64 macOS 15, macos-15-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 11, Build x86_64 macOS 26, macos-26-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 12, Build Arm MacOS 26, macos-26) (push) Has been cancelled
Build and test GAM / build (false, build, 13, Build Intel Windows, windows-2025-vs2026) (push) Has been cancelled
Build and test GAM / build (false, build, 14, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (false, build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (false, build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (false, test, 15, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (false, test, 16, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (false, test, 17, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (false, test, 18, Test Python 3.13, ubuntu-24.04, 3.13) (push) Has been cancelled
Build and test GAM / build (false, test, 19, Test Python 3.15-dev, ubuntu-24.04, 3.15-dev) (push) Has been cancelled
Build and test GAM / build (true, test, 20, Test Python 3.14 freethread, ubuntu-24.04, 3.14) (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
Check for Google Root CA Updates / check-certs (push) Has been cancelled
Daily Dependency Pinning (2-Week Buffer) / pin-deps (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
2026-07-02 11:34:29 -07:00
Jay Lee
e1dbf5b8b3 Update google-auth version to 2.55.1 2026-07-02 12:44:49 -04:00
Ross Scroggs
9d5d6bb9f6 Fixed bug in gam <UserTypeEntity> print sheet #1936 2026-07-02 07:56:45 -07:00
Ross Scroggs
d69a450817 Fixed bug in gam <UserTypeEntity> print sheet #1936 2026-07-02 07:19:32 -07:00
13 changed files with 166 additions and 29 deletions

View File

@@ -16,7 +16,7 @@ dependencies = [
"google-api-python-client==2.197.0",
"google-auth-httplib2==0.4.0",
"google-auth-oauthlib==1.4.0",
"google-auth==2.55.0",
"google-auth==2.55.1",
"httplib2==0.31.2",
"lxml==6.1.1",
"passlib==1.7.4",

View File

@@ -4458,6 +4458,7 @@ gam print licenses [todrive <ToDriveAttribute>*]
gam show licenses
[(products|product <ProductIDList>)|(skus|sku <SKUIDList>)|allskus|gsuite]
[maxresults <Integer>]
gam show configlicenseskus [quiet]
# Mobile Devices

View File

@@ -1,3 +1,40 @@
7.46.07
Added command `gam show configlicenseskus` that can be used to generate a command
that sets the list of used license SKUs in gam.cfg; this improves performance of `gam info user`.
```
gam show configlicenseskus
Got 0 Licenses for 1010010001 (Cloud Identity Free)...
Got 0 Licenses for 1010050001 (Cloud Identity Premium)...
...
Got 2 Licenses for 1010340007 (Google Workspace for Education Fundamentals - Archived User)...
...
Got 100 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 200 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 300 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 358 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 2 Licenses for 1010070004 (Google Workspace for Education Gmail Only)...
...
Got 0 Licenses for Google-Vault (Google Vault)...
Got 0 Licenses for Google-Vault-Former-Employee (Google Vault - Former Employee)...
To set license_skus in gam.cfg, execute the following command:
gam config license_skus "1010340007,1010070001,1010070004" save verify variables license_skus
```
* See: https://github.com/GAM-team/GAM/wiki/Licenses#info-user-performance
7.46.06
Updated GAM to suppress the following message:
```
Regional Access Boundary HTTP request failed after retries: response_data={'error': {'code': 403, 'message': 'Permission denied on the service account.', 'status': 'PERMISSION_DENIED'}}, retryable_error=False
```
7.46.05
Fixed bug in `gam <UserTypeEntity> print sheet` where an extra line of output
was displayed before the CSV data.
7.46.04
Added the following command to transfer secondary calendar ownership.

View File

@@ -14,7 +14,7 @@ if __name__ == '__main__':
multiprocessing.set_start_method('spawn', force=True)
initializeLogging()
#
CallGAMCommand(['gam', 'version'])
CallGAMCommand(['gam', 'version', 'extended'])
# Issue command, output goes to stdout/stderr
rc = CallGAMCommand(['gam', 'info', 'domain'])
# Issue command, redirect stdout/stderr

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.46.04'
__version__ = '7.46.07'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
# pylint: disable=wrong-import-position
@@ -39761,6 +39761,37 @@ def doShowLicenses():
for u_license in licenseCounts:
printEntityKVList(u_license[:-2], [Ent.Plural(u_license[-2]), u_license[-1]])
# gam show configlicenseskus [quiet]
def doShowConfigLicenseSKUs():
lic = buildGAPIObject(API.LICENSING)
setTrueCustomerId()
customerId = _getCustomerId()
licenseSKUcounts = []
maxResults = GC.Values[GC.LICENSE_MAX_RESULTS]
quiet = checkArgumentPresent('quiet')
checkForExtraneousArguments()
fields = getItemFieldsFromFieldsList('items', ['userId'])
for sku in SKU.getAllSKUs():
Ent.SetGetting(Ent.LICENSE)
productId = sku[0]
skuId = sku[1]
productDisplay = SKU.formatProductIdDisplayName(productId)
skuIdDisplay = SKU.formatSKUIdDisplayName(skuId)
pageMessage = getPageMessageForWhom(forWhom=skuIdDisplay) if not quiet else None
try:
feed = callGAPIpages(lic.licenseAssignments(), 'listForProductAndSku', 'items',
pageMessage=pageMessage,
throwReasons=[GAPI.INVALID, GAPI.FORBIDDEN, GAPI.INVALID_ARGUMENT],
customerId=customerId, productId=productId, skuId=skuId,
maxResults=maxResults, fields=fields)
if len(feed) > 0:
licenseSKUcounts.append(skuId)
except (GAPI.invalid, GAPI.forbidden, GAPI.invalidArgument) as e:
entityActionNotPerformedWarning([Ent.PRODUCT, productDisplay, Ent.SKU, skuIdDisplay], str(e))
writeStderr(Msg.CONFIG_LICENSE_SKUS)
flushStderr()
writeStdout(f"gam config license_skus \"{','.join(licenseSKUcounts)}\" save verify variables license_skus\n")
# gam delete alert <AlertID>
# gam undelete alert <AlertID>
def doDeleteOrUndeleteAlert():
@@ -72773,7 +72804,7 @@ def infoPrintShowSheets(users):
i, count, users = getEntityArgument(users)
for user in users:
i += 1
user, sheet, jcount = _validateUserGetSpreadsheetIDs(user, i, count, spreadsheetIdEntity, not FJQC.formatJSON)
user, sheet, jcount = _validateUserGetSpreadsheetIDs(user, i, count, spreadsheetIdEntity, not csvPF and not FJQC.formatJSON)
if jcount == 0:
continue
if showSheetNames:
@@ -81176,6 +81207,7 @@ MAIN_COMMANDS_WITH_OBJECTS = {
Cmd.ARG_CIGROUPMEMBERS: doShowCIGroupMembers,
Cmd.ARG_CIPOLICY: doPrintShowCIPolicies,
Cmd.ARG_CLASSROOMINVITATION: doPrintShowClassroomInvitations,
Cmd.ARG_CONFIGLICENSESKUS: doShowConfigLicenseSKUs,
Cmd.ARG_CONTACT: doPrintShowDomainContacts,
Cmd.ARG_CROSTELEMETRY: doInfoPrintShowCrOSTelemetry,
Cmd.ARG_DATATRANSFER: doPrintShowDataTransfers,
@@ -82454,6 +82486,7 @@ USER_COMMANDS_OBJ_ALIASES = {
Cmd.ARG_CHATSPACES: Cmd.ARG_CHATSPACE,
Cmd.ARG_CIMEMBER: Cmd.ARG_CIGROUPMEMBERS,
Cmd.ARG_CIMEMBERS: Cmd.ARG_CIGROUPMEMBERS,
Cmd.ARG_CONFIGLICENCESKUS: Cmd.ARG_CONFIGLICENSESKUS,
Cmd.ARG_CONTACT: Cmd.ARG_PEOPLECONTACT,
Cmd.ARG_CONTACTS: Cmd.ARG_PEOPLECONTACT,
Cmd.ARG_CONTACTDELEGATES: Cmd.ARG_CONTACTDELEGATE,

View File

@@ -895,6 +895,8 @@ class GamCLArgs():
ARG_CLASSROOMINVITATIONS = 'classroominvitations'
ARG_CLASSROOMOAUTH2 = 'classroomoauth2'
ARG_CLASSROOMPROFILE = 'classroomprofile'
ARG_CONFIGLICENCESKUS = 'configlicenceskus'
ARG_CONFIGLICENSESKUS = 'configlicenseskus'
ARG_CONTACT = 'contact'
ARG_CONTACTS = 'contacts'
ARG_CONTACTDELEGATE = 'contactdelegate'

View File

@@ -216,6 +216,7 @@ COLUMN_DOES_NOT_MATCH_ANY_OUTPUT_COLUMNS = '{0} column "{1}" does not match any
COMMAND_NOT_COMPATIBLE_WITH_ENABLE_DASA = 'gam {0} {1} is not compatible with enable_dasa = true in gam.cfg'
COMMIT_BATCH_COMPLETE = '{0},0/{1},commit-batch - running {2} finished, proceeding\n'
COMMIT_BATCH_WAIT_N_PROCESSES = '{0},0/{1},commit-batch - waiting for {2} running {3} to finish before proceeding\n'
CONFIG_LICENSE_SKUS = 'To set license_skus in gam.cfg, execute the following command:\n'
CONFIRM_WIPE_YUBIKEY_PIV = 'This will wipe all YubiKey PIV keys and configuration from your YubiKey. Are you sure? (y/N) '
CONTACT_ADMINISTRATOR_FOR_PASSWORD = 'Contact administrator for password'
CONTACT_PHOTO_NOT_FOUND = 'Contact photo not found'

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2025 Ross Scroggs All Rights Reserved.
# Copyright (C) 2026 Ross Scroggs All Rights Reserved.
#
# All Rights Reserved.
#
@@ -23,6 +23,7 @@
GAM_VER_LIBS = [
'arrow',
'chardet',
'charset_normalizer',
'cryptography',
'filelock',
'google-api-python-client',
@@ -34,5 +35,6 @@ GAM_VER_LIBS = [
'passlib',
'pathvalidate',
'pyscard',
'urllib3',
'yubikey-manager',
]

View File

@@ -10,6 +10,43 @@ 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.46.07
Added command `gam show configlicenseskus` that can be used to generate a command
that sets the list of used license SKUs in gam.cfg; this improves performance of `gam info user`.
```
gam show configlicenseskus
Got 0 Licenses for 1010010001 (Cloud Identity Free)...
Got 0 Licenses for 1010050001 (Cloud Identity Premium)...
...
Got 2 Licenses for 1010340007 (Google Workspace for Education Fundamentals - Archived User)...
...
Got 100 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 200 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 300 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 358 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 2 Licenses for 1010070004 (Google Workspace for Education Gmail Only)...
...
Got 0 Licenses for Google-Vault (Google Vault)...
Got 0 Licenses for Google-Vault-Former-Employee (Google Vault - Former Employee)...
To set license_skus in gam.cfg, execute the following command:
gam config license_skus "1010340007,1010070001,1010070004" save verify variables license_skus
```
* See: https://github.com/GAM-team/GAM/wiki/Licenses#info-user-performance
### 7.46.06
Updated GAM to suppress the following message:
```
Regional Access Boundary HTTP request failed after retries: response_data={'error': {'code': 403, 'message': 'Permission denied on the service account.', 'status': 'PERMISSION_DENIED'}}, retryable_error=False
```
### 7.46.05
Fixed bug in `gam <UserTypeEntity> print sheet` where an extra line of output
was displayed before the CSV data.
### 7.46.04
Added the following command to transfer secondary calendar ownership.

View File

@@ -747,4 +747,4 @@ Windows PowerShell
$count = & gam print groups showitemcountonly
Windows Command Prompt
for /f "delims=" %a in ('gam print groups showitemcountonly') do set count=%a
```

View File

@@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt.
```
gamteam@server:/Users/gamteam$ rm -f /Users/gamteam/GAMConfig/oauth2.txt
gamteam@server:/Users/gamteam$ gam version
GAM .46.04 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.46.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.6 64-bit final
macOS Tahoe 26.5.1 arm64
@@ -1034,7 +1034,7 @@ writes the credentials into the file oauth2.txt.
```
C:\>del C:\GAMConfig\oauth2.txt
C:\>gam version
GAM .46.04 - https://github.com/GAM-team/GAM - pythonsource
GAM 7.46.07 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.6 64-bit final
Windows 11 10.0.26200 AMD64

View File

@@ -249,25 +249,47 @@ If you do a couple of info user commands back to back, you start to run into quo
You can help yourself in the following way: generate a list of all of the license SKUs that exist in your workspace.
```
gam config csv_output_row_filter "licenses:count>0" print license countsonly allskus
Got 0 Licenses for 1010010001 (Cloud Identity)...
gam show configlicenseskus
Got 0 Licenses for 1010010001 (Cloud Identity Free)...
Got 0 Licenses for 1010050001 (Cloud Identity Premium)...
...
Got 2 Licenses for 1010340007 (Google Workspace for Education Fundamentals - Archived User)...
...
Got 100 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 200 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 300 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 358 Licenses for 1010070001 (Google Workspace for Education Fundamentals)...
Got 2 Licenses for 1010070004 (Google Workspace for Education Gmail Only)...
...
Got 0 Licenses for Google-Vault (Google Vault)...
Got 0 Licenses for Google-Vault-Former-Employee (Google Vault - Former Employee)...
productId,productDisplay,skuId,skuDisplay,licenses
101031,Google Workspace for Education,1010310008,Google Workspace for Education Plus,410
101031,Google Workspace for Education,1010310009,Google Workspace for Education Plus (Staff),103
101033,Google Voice,1010330004,Google Voice Standard,3
Google-Apps,Google Workspace,1010070001,Google Workspace for Education Fundamentals,1453
To set license_skus in gam.cfg, execute the following command:
gam config license_skus "1010340007,1010070001,1010070004" save verify variables license_skus
```
Then do (example, use your actual list):
`gam config license_skus 1010310008,1010310009,1010330004,1010070001 save`
```
gam config license_skus 1010310008,1010310009,1010330004,1010070001 save verify variables license_skus
Config File: /Users/gamteam/GamConfig/gam.cfg, Saved
Section: DEFAULT
license_skus = 1010340007,1010070001,1010070004
```
Now, rather that asking 73 questions per user, GAM will only ask about the license SKUs in the list.
It is much less likely that quota issues will occur,
You can script this:
```
Linux/MacOS
eval $(gam show configlicenseskus)
Windows PowerShell
iex $(gam show configlicenseskus)
Windows Command Prompt
for /f "delims=" %a in ('gam show configlicenseskus') do @(%a)
Windows Batch File
for /f "delims=" %%a in ('gam show configlicenseskus') do @(%%a)
```
## Display license counts
```
gam show licenses

View File

@@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAM .46.04 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.46.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.6 64-bit final
macOS Tahoe 26.5.1 arm64
@@ -15,7 +15,7 @@ Time: 2026-02-15T07:51:00-08:00
Print the current version of Gam with details and time offset information
```
gam version timeoffset
GAM .46.04 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.46.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.6 64-bit final
macOS Tahoe 26.5.1 arm64
@@ -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 .46.04 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.46.07 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.6 64-bit final
macOS Tahoe 26.5.1 arm64
@@ -35,21 +35,23 @@ Path: /Users/gamteam/bin/gam7
Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2026-02-15T07:51:00-08:00
Your system time differs from admin.googleapis.com by less than 1 second
OpenSSL 4.0.1 9 Jun 2026
OpenSSL 3.5.7 9 Jun 2026
arrow 1.4.0
chardet 7.4.3
cryptography 48.0.0
filelock 3.29.0
google-api-python-client 2.196.0
charset_normalizer 3.4.7
cryptography 48.0.1
filelock 3.29.4
google-api-python-client 2.197.0
google-auth-httplib2 0.4.0
google-auth-oauthlib 1.4.0
google-auth 2.53.0
google-auth 2.55.1
lxml 6.1.1
httplib2 0.31.2
passlib 1.7.4
pathvalidate 3.3.1
pyscard 2.3.1
yubikey-manager 5.9.1
pyscard 2.3.0
urllib3 2.7.0
yubikey-manager 5.8.0
admin.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384
```
@@ -68,7 +70,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/gamteam/bin/gam7
Version Check:
Current: 5.35.08
Latest: .46.04
Latest: 7.46.07
echo $?
1
```
@@ -76,7 +78,7 @@ echo $?
Print the current version number without details
```
gam version simple
.46.04
7.46.07
```
In Linux/MacOS you can do:
```
@@ -86,7 +88,7 @@ echo $VER
Print the current version of Gam and address of this Wiki
```
gam help
GAM .46.04 - https://github.com/GAM-team/GAM
GAM 7.46.07 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.6 64-bit final
macOS Tahoe 26.5.1 arm64