Compare commits

..

24 Commits

Author SHA1 Message Date
Ross Scroggs
a95da4e2ea Added option oneuserperrow to gam print devices 2025-05-30 06:22:30 -07:00
Ross Scroggs
fce8704f87 Fixed bugs/cleaned output in gam info|print cros
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
2025-05-29 17:38:53 -07:00
Ross Scroggs
4d3b72900b Fixed bugs/cleaned output in gam info|print cros. 2025-05-29 17:17:33 -07:00
Ross Scroggs
fd81d56675 Fixed bugs/cleaned output in gam info|print cros. 2025-05-29 17:17:05 -07:00
Ross Scroggs
762d8479a4 Added chromeostype, diskspaceusage and faninfo to <CrOSFieldName> 2025-05-29 09:36:36 -07:00
Ross Scroggs
6f19ec4f8c Update Vault-Takeout.md
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
2025-05-28 14:56:28 -07:00
Ross Scroggs
8af3bc60e6 Added option shareddrivesoption included|included_if_account_is_not_a_member|not_included to gam create vaultexport. 2025-05-28 14:28:38 -07:00
Ross Scroggs
e636a69431 Added option shareddrivesoption included|included_if_account_is_not_a_member|not_included to gam create vaultexport.tion shareddrivesoption included|included_if_account_is_not_a_member|not_included to vault commands 2025-05-28 14:27:35 -07:00
Ross Scroggs
673460e91d Update Chat docs
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
2025-05-28 09:38:31 -07:00
Ross Scroggs
9862ad446f Update Chat-Bot.md 2025-05-28 09:10:28 -07:00
Ross Scroggs
67f21ce650 Update gam setup chat output 2025-05-28 09:04:02 -07:00
Ross Scroggs
e82baccbac Merge branch 'main' of https://github.com/GAM-team/GAM 2025-05-28 09:02:43 -07:00
Ross Scroggs
c51b06a6c3 Update gam setup chat output 2025-05-28 09:01:22 -07:00
Jay Lee
b7415cd63f forward compat fix for setuptools issue #1778 2025-05-28 14:06:37 +00:00
Jay Lee
f0f5803698 no need to pin pyscard any longer, align requirements 2025-05-28 13:21:06 +00:00
Ross Scroggs
575fdea526 Use setuptools 80.8.0
Some checks failed
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Push wiki / pushwiki (push) Has been cancelled
2025-05-27 18:31:39 -07:00
Ross Scroggs
f8ee94bad8 Update Users-Drive-Permissions.md 2025-05-27 17:47:34 -07:00
Ross Scroggs
4b6c8fb518 Update Users-Drive-Permissions.md 2025-05-27 17:08:26 -07:00
Ross Scroggs
4f8c80dcab Added option showitemcountonly to gam [<UserTypeEntity>] print|show shareddrives 2025-05-27 13:21:43 -07:00
Ross Scroggs
12f5c5e670 Added option showitemcountonly to gam [<UserTypeEntity>] print|show shareddrives 2025-05-27 13:21:31 -07:00
Ross Scroggs
a1216b6782 Update Users-Drive-Copy-Move.md
Some checks failed
Push wiki / pushwiki (push) Has been cancelled
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
2025-05-27 08:00:13 -07:00
Ross Scroggs
05f4795bc3 Update Users-Drive-Copy-Move.md 2025-05-27 07:58:12 -07:00
Ross Scroggs
e1ff1ba378 Update Users-Drive-Copy-Move.md 2025-05-27 07:56:47 -07:00
Ross Scroggs
5b2804643e Fixed bug in gam print|show oushareddrives that caused a trap.
Some checks failed
Push wiki / pushwiki (push) Has been cancelled
Build and test GAM / build (build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (build, 10, Build Intel Windows, windows-2022) (push) Has been cancelled
Build and test GAM / build (build, 11, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (build, 7, Build Intel MacOS, macos-13) (push) Has been cancelled
Build and test GAM / build (build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (test, 12, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (test, 13, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (test, 14, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (test, 15, Test Python 3.14-dev, ubuntu-24.04, 3.14-dev) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-apis (push) Has been cancelled
Improved getting Shared Drive names from IDs when accessing Shared Drives in external workspaces.
2025-05-26 12:41:34 -07:00
20 changed files with 362 additions and 94 deletions

View File

@@ -449,7 +449,7 @@ jobs:
"$PYTHON" get-pip.py
"$PYTHON" -m pip install --upgrade pip
"$PYTHON" -m pip install --upgrade wheel
"$PYTHON" -m pip install --upgrade setuptools
"$PYTHON" -m pip install setuptools
"$PYTHON" -m pip install --upgrade importlib-metadata
"$PYTHON" -m pip install --upgrade setuptools-scm
"$PYTHON" -m pip list

View File

@@ -21,8 +21,8 @@ dependencies = [
"lxml>=5.4.0",
"passlib>=1.7.4",
"pathvalidate>=3.2.3",
"pyscard==2.2.1",
"python-dateutil",
"yubikey-manager>=5.6.1",
]
description = "CLI tool to manage Google Workspace"
readme = "README.md"

View File

@@ -2396,12 +2396,14 @@ gam <CrOSTypeEntity> update <CrOSAttribute>+ [quickcrosmove [<Boolean>]] [nobatc
autoupdatethrough|
backlightinfo|
bootmode|
chromeostype|
cpuinfo|
cpustatusreports|
deprovisionreason|
devicefiles|
deviceid|
devicelicensetype|
diskspaceusage|
diskvolumereports|
dockmacaddress|
ethernetmacaddress|
@@ -2409,6 +2411,7 @@ gam <CrOSTypeEntity> update <CrOSAttribute>+ [quickcrosmove [<Boolean>]] [nobatc
extendedsupporteligible|
extendedsupportstart|
extendedsupportenabled|
faninfo|
firmwareversion|
firstenrollmenttime|
lastdeprovisiontimestamp|
@@ -4116,7 +4119,7 @@ gam print devices [todrive <ToDriveAttribute>*]
<DeviceFieldName>* [fields <DeviceFieldNameList>] [userfields <DeviceUserFieldNameList>]
[orderby <DeviceOrderByFieldName> [ascending|descending]]
[all|company|personal|nocompanydevices|nopersonaldevices]
[nodeviceusers]
[nodeviceusers|oneuserperrow]
[formatjson [quotechar <Character>]]
[showitemcountonly]
@@ -5260,7 +5263,8 @@ gam create vaultexport|export matter <MatterItem> [name <String>] corpus calenda
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>]
[locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
[responsestatuses <AttendeeStatus>(,<AttendeeStatus>)*] [calendarversiondate <Date>|<Time>]
[includeshareddrives <Boolean>] [driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
[(includeshareddrives <Boolean>)|(shareddrivesoption included|included_if_account_is_not_a_member|not_included)]
[driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
[driveclientsideencryption any|encrypted|unencrypted]
[includerooms <Boolean>]
[excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
@@ -5326,14 +5330,14 @@ gam create vaulthold|hold matter <MatterItem> [name <String>] corpus calendar|dr
[query <QueryVaultCorpus>]
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
[includeshareddrives|includeteamdrives <Boolean>]
[includeshareddrives <Boolean>]
[showdetails|returnidonly]
gam update vaulthold|hold <HoldItem> matter <MatterItem>
[([addaccounts|addgroups|addusers <EmailItemList>] [removeaccounts|removegroups|removeusers <EmailItemList>]) | (orgunit|org|ou <OrgUnit>)]
[query <QueryVaultCorpus>]
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
[includeshareddrives|includeteamdrives <Boolean>]
[includeshareddrives <Boolean>]
[showdetails]
gam delete vaulthold|hold <HoldItem> matter <MatterItem>
gam delete vaulthold|hold <MatterItem> <HoldItem>

View File

@@ -1,3 +1,34 @@
7.07.17
Added option `oneuserperrow` to `gam print devices` to have each of a
device's users displayed on a separate row with all of the other device fields.
7.07.16
Added `chromeostype`, `diskspaceusage` and `faninfo` to `<CrOSFieldName>` for use in `gam info|print cros`.
Fixed bugs/cleaned output in `gam info|print cros`.
7.07.15
Added option `shareddrivesoption included|included_if_account_is_not_a_member|not_included` to `gam create vaultexport`.
The previous option `includeshareddrives <Boolean>` is mapped as follows:
* `includeshareddrives false` - `shareddrivesoption included_if_account_is_not_a_member`
* `includeshareddrives true` - `shareddrivesoption included`
7.07.14
Update `gam setup chat` output to include the following that shows the actual Cloud Pub/Sub Topic Name.
```
You'll use projects/<ProjectID>/topics/no-topic in Connection settings Cloud Pub/Sub Topic Name
```
7.07.13
Added option `showitemcountonly` to `gam [<UserTypeEntity>] print|show shareddrives` that causes GAM to display the
number of Shared Drives on stdout; no CSV file is written.
7.07.12
Fixed bug in `gam print|show oushareddrives` that caused a trap.

View File

@@ -38,6 +38,10 @@ hiddenimports = [
'gam.gamlib.yubikey',
]
excludes = [
'pkg_resources',
]
runtime_hooks = []
a = Analysis(
['gam/__main__.py'],
@@ -48,7 +52,7 @@ a = Analysis(
hookspath=[],
hooksconfig={},
runtime_hooks=runtime_hooks,
excludes=[],
excludes=excludes,
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=None,

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.07.12'
__version__ = '7.07.17'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
#pylint: disable=wrong-import-position
@@ -23759,12 +23759,14 @@ CROS_FIELDS_CHOICE_MAP = {
'autoupdatethrough': 'autoUpdateThrough',
'backlightinfo': 'backlightInfo',
'bootmode': 'bootMode',
'chromeostype': 'chromeOsType',
'cpuinfo': 'cpuInfo',
'cpustatusreports': 'cpuStatusReports',
'deprovisionreason': 'deprovisionReason',
'devicefiles': ['deviceFiles.type', 'deviceFiles.createTime'],
'deviceid': 'deviceId',
'devicelicensetype': 'deviceLicenseType',
'diskspaceusage': 'diskSpaceUsage',
'diskvolumereports': 'diskVolumeReports',
'dockmacaddress': 'dockMacAddress',
'ethernetmacaddress': 'ethernetMacAddress',
@@ -23772,6 +23774,7 @@ CROS_FIELDS_CHOICE_MAP = {
'extendedsupporteligible': 'extendedSupportEligible',
'extendedsupportstart': 'extendedSupportStart',
'extendedsupportenabled': 'extendedSupportEnabled',
'faninfo': 'fanInfo',
'firmwareversion': 'firmwareVersion',
'firstenrollmenttime': 'firstEnrollmentTime',
'lastdeprovisiontimestamp': 'lastDeprovisionTimestamp',
@@ -23819,6 +23822,7 @@ CROS_SCALAR_PROPERTY_PRINT_ORDER = [
'notes',
'serialNumber',
'status',
'chromeOsType',
'deviceLicenseType',
'model',
'firmwareVersion',
@@ -23839,6 +23843,7 @@ CROS_SCALAR_PROPERTY_PRINT_ORDER = [
'manufactureDate',
'supportEndDate',
'autoUpdateExpiration',
'autoUpdateThrough',
'willAutoRenew',
]
@@ -23863,8 +23868,11 @@ CROS_TIME_OBJECTS = {
'lastDeprovisionTimestamp',
'lastEnrollmentTime',
'lastSync',
'rebootTime',
'reportTime',
'supportEndDate',
'updateTime',
'updateCheckTime',
}
CROS_FIELDS_WITH_CRS_NLS = {'notes'}
CROS_START_ARGUMENTS = ['start', 'startdate', 'oldestdate']
@@ -23981,13 +23989,13 @@ def infoCrOSDevices(entityList):
printKeyValueWithCRsNLs(up, cros[up])
else:
printKeyValueList([up, formatLocalTime(cros[up])])
up = 'tpmVersionInfo'
if up in cros:
printKeyValueList([up, ''])
Ind.Increment()
for key, value in sorted(iter(cros[up].items())):
printKeyValueList([key, value])
Ind.Decrement()
for up in ['diskSpaceUsage', 'osUpdateStatus', 'tpmVersionInfo']:
if up in cros:
printKeyValueList([up, ''])
Ind.Increment()
for key, value in sorted(iter(cros[up].items())):
printKeyValueList([key, value])
Ind.Decrement()
if not noLists:
activeTimeRanges = _filterActiveTimeRanges(cros, True, listLimit, startDate, endDate, activeTimeRangesOrder)
if activeTimeRanges:
@@ -24041,6 +24049,9 @@ def infoCrOSDevices(entityList):
entityActionNotPerformedWarning([Ent.CROS_DEVICE, deviceId, Ent.DEVICE_FILE, downloadfile],
Msg.NO_ENTITIES_FOUND.format(Ent.Plural(Ent.DEVICE_FILE)), i, count)
Act.Set(Act.INFO)
cpuInfo = _filterBasicList(cros, 'cpuInfo', True, listLimit)
if cpuInfo:
showJSON('cpuInfo', cpuInfo, dictObjectsKey={'cpuInfo': 'model'})
cpuStatusReports = _filterCPUStatusReports(cros, True, listLimit, startTime, endTime)
if cpuStatusReports:
printKeyValueList(['cpuStatusReports'])
@@ -24058,6 +24069,12 @@ def infoCrOSDevices(entityList):
printKeyValueList(['cpuUtilizationPercentageInfo', cpuStatusReport['cpuUtilizationPercentageInfo']])
Ind.Decrement()
Ind.Decrement()
backlightInfo = _filterBasicList(cros, 'backLightInfo', True, listLimit)
if backlightInfo:
showJSON('backlightInfo', backlightInfo, dictObjectsKey={'backlightInfo': 'path'})
fanInfo = _filterBasicList(cros, 'fanInfo', True, listLimit)
if fanInfo:
showJSON('fanInfo', fanInfo)
diskVolumeReports = _filterBasicList(cros, 'diskVolumeReports', True, listLimit)
if diskVolumeReports:
printKeyValueList(['diskVolumeReports'])
@@ -24284,7 +24301,7 @@ CROS_ENTITIES_MAP = {
}
CROS_INDEXED_TITLES = ['activeTimeRanges', 'recentUsers', 'deviceFiles',
'cpuStatusReports', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports']
'cpuStatusReports', 'cpuInfo', 'backlightInfo', 'fanInfo', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports']
# gam print cros [todrive <ToDriveAttribute>*]
# [(query <QueryCrOS>)|(queries <QueryCrOSList>) [querytime<String> <Time>]
@@ -24331,12 +24348,15 @@ def doPrintCrOSDevices(entityList=None):
if not noLists and not selectedLists:
csvPF.WriteRowTitles(flattenJSON(cros, listLimit=listLimit, timeObjects=CROS_TIME_OBJECTS))
return
attrib = 'tpmVersionInfo'
if attrib in cros:
for key, value in sorted(iter(cros[attrib].items())):
attribKey = f'{attrib}{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{key}'
cros[attribKey] = value
cros.pop(attrib)
for attrib in ['diskSpaceUsage', 'osUpdateStatus', 'tpmVersionInfo']:
if attrib in cros:
for key, value in sorted(iter(cros[attrib].items())):
attribKey = f'{attrib}{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{key}'
if key not in CROS_TIME_OBJECTS:
cros[attribKey] = value
else:
cros[attribKey] = formatLocalTime(value)
cros.pop(attrib)
activeTimeRanges = _filterActiveTimeRanges(cros, selectedLists.get('activeTimeRanges', False), listLimit, startDate, endDate, activeTimeRangesOrder)
recentUsers = _filterRecentUsers(cros, selectedLists.get('recentUsers', False), listLimit)
deviceFiles = _filterDeviceFiles(cros, selectedLists.get('deviceFiles', False), listLimit, startTime, endTime)
@@ -24350,8 +24370,10 @@ def doPrintCrOSDevices(entityList=None):
return
row = {}
for attrib in cros:
if attrib not in {'kind', 'etag', 'tpmVersionInfo', 'recentUsers', 'activeTimeRanges',
'deviceFiles', 'cpuStatusReports', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports'}:
if attrib in {'cpuInfo', 'backlightInfo', 'fanInfo'}:
flattenJSON({attrib: cros[attrib]}, flattened=row)
elif attrib not in {'kind', 'etag', 'diskSpaceUsage', 'osUpdateStatus', 'tpmVersionInfo', 'activeTimeRanges', 'recentUsers',
'deviceFiles', 'cpuStatusReports', 'diskVolumeReports', 'lastKnownNetwork', 'screenshotFiles', 'systemRamFreeReports'}:
if attrib not in CROS_TIME_OBJECTS:
row[attrib] = cros[attrib]
else:
@@ -25949,7 +25971,7 @@ def _printChatItem(user, citem, parent, entityType, csvPF, FJQC, addCSVData=None
def doSetupChat():
checkForExtraneousArguments()
_, chat , _ = buildChatServiceObject()
writeStdout(Msg.TO_SET_UP_GOOGLE_CHAT.format(setupChatURL(chat)))
writeStdout(Msg.TO_SET_UP_GOOGLE_CHAT.format(setupChatURL(chat), GM.Globals[GM.OAUTH2SERVICE_JSON_DATA]['project_id']))
def getSpaceName(myarg):
if myarg == 'space':
@@ -29565,7 +29587,7 @@ DEVICE_ORDERBY_CHOICE_MAP = {
# <DeviceFieldName>* [fields <DeviceFieldNameList>] [userfields <DeviceUserFieldNameList>]
# [orderby <DeviceOrderByFieldName> [ascending|descending]]
# [all|company|personal|nocompanydevices|nopersonaldevices]
# [nodeviceusers]
# [nodeviceusers|oneuserperrow]
# [formatjson [quotechar <Character>]]
# [showitemcountonly]
def doPrintCIDevices():
@@ -29581,7 +29603,7 @@ def doPrintCIDevices():
queries = [None]
view, entityType = DEVICE_VIEW_CHOICE_MAP['all']
getDeviceUsers = True
showItemCountOnly = False
oneUserPerRow = showItemCountOnly = False
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if csvPF and myarg == 'todrive':
@@ -29596,6 +29618,8 @@ def doPrintCIDevices():
view, entityType = DEVICE_VIEW_CHOICE_MAP[myarg]
elif myarg == 'nodeviceusers':
getDeviceUsers = False
elif myarg in {'oneuserperrow', 'oneitemperrow'}:
getDeviceUsers = oneUserPerRow = True
elif getFieldsList(myarg, DEVICE_FIELDS_CHOICE_MAP, fieldsList, initialField='name'):
pass
elif getFieldsList(myarg, DEVICEUSER_FIELDS_CHOICE_MAP, userFieldsList, initialField='name', fieldsArg='userfields'):
@@ -29609,6 +29633,8 @@ def doPrintCIDevices():
fields = getItemFieldsFromFieldsList('devices', fieldsList)
userFields = getItemFieldsFromFieldsList('deviceUsers', userFieldsList)
substituteQueryTimes(queries, queryTimes)
if FJQC.formatJSON and oneUserPerRow:
csvPF.SetJSONTitles(['name', 'user.name', 'JSON'])
itemCount = 0
for query in queries:
printGettingAllAccountEntities(entityType, query)
@@ -29650,13 +29676,26 @@ def doPrintCIDevices():
except (GAPI.invalid, GAPI.invalidArgument, GAPI.permissionDenied) as e:
entityActionFailedWarning([entityType, None], str(e))
for device in devices:
row = flattenJSON(device, timeObjects=DEVICE_TIME_OBJECTS)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
csvPF.WriteRowNoFilter({'name': device['name'],
'JSON': json.dumps(cleanJSON(device, timeObjects=DEVICE_TIME_OBJECTS),
ensure_ascii=False, sort_keys=True)})
if not oneUserPerRow or 'users' not in device:
row = flattenJSON(device, timeObjects=DEVICE_TIME_OBJECTS)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
csvPF.WriteRowNoFilter({'name': device['name'],
'JSON': json.dumps(cleanJSON(device, timeObjects=DEVICE_TIME_OBJECTS),
ensure_ascii=False, sort_keys=True)})
else:
deviceUsers = device.pop('users')
baserow = flattenJSON(device, timeObjects=DEVICE_TIME_OBJECTS)
for deviceUser in deviceUsers:
row = flattenJSON({'user': deviceUser}, flattened=baserow.copy(), timeObjects=DEVICE_TIME_OBJECTS)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
device['user'] = deviceUser
csvPF.WriteRowNoFilter({'name': device['name'], 'user.name': deviceUser['name'],
'JSON': json.dumps(cleanJSON(device, timeObjects=DEVICE_TIME_OBJECTS),
ensure_ascii=False, sort_keys=True)})
if showItemCountOnly:
writeStdout(f'{itemCount}\n')
return
@@ -40817,6 +40856,11 @@ VAULT_RESPONSE_STATUS_MAP = {
'needsaction': 'ATTENDEE_RESPONSE_NEEDS_ACTION',
'tentative': 'ATTENDEE_RESPONSE_TENTATIVE',
}
VAULT_SHARED_DRIVES_OPTION_MAP = {
'included': 'INCLUDED',
'includedifaccountisnotamember': 'INCLUDED_IF_ACCOUNT_IS_NOT_A_MEMBER',
'notincluded': 'NOT_INCLUDED',
}
VAULT_VOICE_COVERED_DATA_MAP = {
'calllogs': 'CALL_LOGS',
'textmessages': 'TEXT_MESSAGES',
@@ -40875,7 +40919,7 @@ VAULT_QUERY_ARGS = [
# calendar
'locationquery', 'peoplequery', 'minuswords', 'responsestatuses', 'caldendarversiondate',
# drive
'driveclientsideencryption', 'driveversiondate', 'includeshareddrives', 'includeteamdrives',
'driveclientsideencryption', 'driveversiondate', 'includeshareddrives', 'includeteamdrives', 'shareddrivesoption',
# hangoutsChat
'includerooms',
# mail
@@ -40945,7 +40989,9 @@ def _buildVaultQuery(myarg, query, corpusArgumentMap):
elif myarg == 'driveversiondate':
query.setdefault('driveOptions', {})['versionDate'] = getTimeOrDeltaFromNow()
elif myarg in {'includeshareddrives', 'includeteamdrives'}:
query.setdefault('driveOptions', {})['includeSharedDrives'] = getBoolean()
query.setdefault('driveOptions', {})['sharedDrivesOption'] = 'INCLUDED' if getBoolean() else 'INCLUDED_IF_ACCOUNT_IS_NOT_A_MEMBER'
elif myarg == 'shareddrivesoption':
query.setdefault('driveOptions', {})['sharedDrivesOption'] = getChoice(VAULT_SHARED_DRIVES_OPTION_MAP, mapChoice=True)
elif myarg == 'driveclientsideencryption':
query.setdefault('driveOptions', {})['clientSideEncryptedOption'] = getChoice(VAULT_CSE_OPTION_MAP, mapChoice=True)
# hangoutsChat
@@ -40979,7 +41025,8 @@ def _validateVaultQuery(body, corpusArgumentMap):
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>]
# [locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
# [responsestatuses <AttendeeStatus>(,<AttendeeStatus>)*] [calendarversiondate <Date>|<Time>]
# [includeshareddrives <Boolean>] [driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
# [(includeshareddrives <Boolean>)|(shareddrivesoption included|included_if_account_is_not_a_member|not_included)]
# [driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
# [driveclientsideencryption any|encrypted|unencrypted]
# [includerooms <Boolean>]
# [excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
@@ -41050,7 +41097,7 @@ def doCreateVaultExport():
try:
export = callGAPI(v.matters().exports(), 'create',
throwReasons=[GAPI.ALREADY_EXISTS, GAPI.BAD_REQUEST, GAPI.BACKEND_ERROR, GAPI.INVALID_ARGUMENT,
GAPI.INVALID, GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.QUOTA_EXCEEDED],
GAPI.INVALID, GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.QUOTA_EXCEEDED, GAPI.NOT_FOUND],
matterId=matterId, body=body)
if not returnIdOnly:
entityActionPerformed([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_EXPORT, formatVaultNameId(export['name'], export['id'])])
@@ -41059,7 +41106,7 @@ def doCreateVaultExport():
else:
writeStdout(f'{export["id"]}\n')
except (GAPI.alreadyExists, GAPI.badRequest, GAPI.backendError, GAPI.invalidArgument,
GAPI.invalid, GAPI.failedPrecondition, GAPI.forbidden, GAPI.quotaExceeded) as e:
GAPI.invalid, GAPI.failedPrecondition, GAPI.forbidden, GAPI.quotaExceeded, GAPI.notFound) as e:
entityActionFailedWarning([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_EXPORT, body.get('name')], str(e))
# gam delete vaultexport|export <ExportItem> matter <MatterItem>
@@ -41573,7 +41620,7 @@ def _setHoldQuery(body, queryParameters):
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
# [includerooms <Boolean>]
# [covereddata calllogs|textmessages|voicemails]
# [includeshareddrives|includeteamdrives <Boolean>]
# [includeshareddrives <Boolean>]
# [showdetails|returnidonly]
def doCreateVaultHold():
v = buildGAPIObject(API.VAULT)
@@ -41639,7 +41686,7 @@ def doCreateVaultHold():
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
# [includerooms <Boolean>]
# [covereddata calllogs|textmessages|voicemails]
# [includeshareddrives|includeteamdrives <Boolean>]
# [includeshareddrives <Boolean>]
# [showdetails]
def doUpdateVaultHold():
v = buildGAPIObject(API.VAULT)
@@ -59838,6 +59885,7 @@ def copyDriveFile(users):
# Source at root of Shared Drive?
sourceMimeType = source['mimeType']
if sourceMimeType == MIMETYPE_GA_FOLDER and source.get('driveId') and source['name'] == TEAM_DRIVE and not source.get('parents', []):
copyMoveOptions['sourceIsMyDriveSharedDrive'] = True
source['name'] = _getSharedDriveNameFromId(drive, source['driveId'])
sourceName = source['name']
sourceNameId = f"{sourceName}({source['id']})"
@@ -65416,12 +65464,14 @@ SHAREDDRIVE_ACL_ROLES_MAP = {
# (role|roles <SharedDriveACLRoleList>)*
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
# [guiroles [<Boolean>]] [formatjson [quotechar <Character>]]
# [showitemcountonly]
# gam <UserTypeEntity> show shareddrives
# [asadmin [shareddriveadminquery|query <QuerySharedDrive>]]
# [matchname <REMatchPattrn>] [orgunit|org|ou <OrgUnitPath>]
# (role|roles <SharedDriveACLRoleLIst>)*
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
# [guiroles [<Boolean>]] [formatjson]
# [showitemcountonly]
def printShowSharedDrives(users, useDomainAdminAccess=False):
def stripNonShowFields(shareddrive):
if orgUnitIdToPathMap:
@@ -65445,7 +65495,7 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
SHAREDDRIVE_FIELDS_CHOICE_MAP.update(SHAREDDRIVE_LIST_FIELDS_CHOICE_MAP)
showOrgUnitPaths = True
orgUnitIdToPathMap = None
guiRoles = False
guiRoles = showItemCountOnly = False
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if csvPF and myarg == 'todrive':
@@ -65475,6 +65525,9 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
showOrgUnitPaths = not getBoolean()
elif myarg == 'guiroles':
guiRoles = getBoolean()
elif myarg == 'showitemcountonly':
showItemCountOnly = True
showOrgUnitPaths = False
else:
FJQC.GetFormatJSONQuoteChar(myarg, True)
if query and not useDomainAdminAccess:
@@ -65544,6 +65597,9 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
jcount = len(matchedFeed)
if jcount == 0:
setSysExitRC(NO_ENTITIES_FOUND_RC)
if showItemCountOnly:
writeStdout(f'{jcount}\n')
return
if not csvPF:
if not FJQC.formatJSON:
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count)
@@ -65574,9 +65630,11 @@ def doPrintShowSharedDrives():
# gam print oushareddrives [todrive <ToDriveAttribute>*]
# [ou|org|orgunit <OrgUnitPath>]
# [formatjson [quotechar <Character>]]
# [showitemcountonly]
# gam show oushareddrives
# [ou|org|orgunit <OrgUnitPath>]
# [formatjson]
# [showitemcountonly]
def doPrintShowOrgunitSharedDrives():
def _getOrgUnitSharedDriveInfo(shareddrive):
shareddrive['driveId'] = shareddrive['name'].rsplit(';')[1]
@@ -65605,12 +65663,15 @@ def doPrintShowOrgunitSharedDrives():
csvPF = CSVPrintFile(['name', 'type', 'member', 'memberUri', 'driveId', 'driveName', 'orgUnitPath']) if Act.csvFormat() else None
FJQC = FormatJSONQuoteChar(csvPF)
orgUnitPath = '/'
showItemCountOnly = False
while Cmd.ArgumentsRemaining():
myarg = getArgument()
if csvPF and myarg == 'todrive':
csvPF.GetTodriveParameters()
elif myarg in {'ou', 'org', 'orgunit'}:
orgUnitPath = getString(Cmd.OB_ORGUNIT_ITEM)
elif myarg == 'showitemcountonly':
showItemCountOnly = True
else:
FJQC.GetFormatJSONQuoteChar(myarg, True)
if csvPF and FJQC.formatJSON:
@@ -65625,6 +65686,9 @@ def doPrintShowOrgunitSharedDrives():
jcount = len(sds)
if jcount == 0:
setSysExitRC(NO_ENTITIES_FOUND_RC)
if showItemCountOnly:
writeStdout(f'{jcount}\n')
return
if not csvPF:
if not FJQC.formatJSON:
entityPerformActionNumItems([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], jcount, Ent.SHAREDDRIVE)

View File

@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
# Copyright (C) 2025 Ross Scroggs All Rights Reserved.
#
# All Rights Reserved.
#
@@ -504,13 +504,15 @@ TO = 'To'
TO_LC = 'to'
TO_MAXIMUM_OF = 'to maximum of'
TO_SET_UP_GOOGLE_CHAT = """
To set up Google Chat for your API project, please go to:
To set up Google Chat for your current project, please go to:
{0}
and follow the instructions at:
https://github.com/GAM-team/GAM/wiki/Chat-Bot#set-up-a-chat-bot
You'll use projects/{1}/topics/no-topic in Connection settings Cloud Pub/Sub Topic Name
"""
TOTAL_ITEMS_IN_ENTITY = 'Total {0} in {1}'
TRIMMED_MESSAGE_FROM_LENGTH_TO_MAXIMUM = 'Trimmed message of length {0} to maximum length {1}'

View File

@@ -10,6 +10,5 @@ httplib2>=0.22.0
lxml>=5.4.0
passlib>=1.7.4
pathvalidate>=3.2.3
pyscard==2.2.1
python-dateutil
yubikey-manager>=5.6.1

View File

@@ -37,7 +37,6 @@ install_requires =
lxml >= 5.4.0
passlib >= 1.7.4
pathvalidate >= 3.2.3
pyscard == 2.2.1
python-dateutil
yubikey-manager >= 5.6.1

View File

@@ -1,8 +1,8 @@
# Chat Bot
- [Introduction](#introduction)
- [Set up a Chat Bot](#set-up-a-chat-bot)
- [API documentation](#api-documentation)
- [Definitions](#definitions)
- [Set up a Chat Bot](#set-up-a-chat-bot)
- [Display Rooms and Chats to which your Bot belongs](#display-rooms-and-chats-to-which-your-bot-belongs)
- [Display Members of a Room or Chat](#display-members-of-a-room-or-chat)
- [Create a Chat Message](#create-a-chat-message)
@@ -10,6 +10,43 @@
- [Delete a Chat Message](#delete-a-chat-message)
- [Display a Chat Message](#display-a-chat-message)
## Introduction
To use these commands you must update your service account authorization.
```
gam user user@domain.com update serviceaccount
[*] 4) Chat API - Memberships (supports readonly)
[*] 5) Chat API - Memberships Admin (supports readonly)
[*] 6) Chat API - Messages (supports readonly)
[*] 7) Chat API - Spaces (supports readonly)
[*] 8) Chat API - Spaces Admin (supports readonly)
[*] 9) Chat API - Spaces Delete
[*] 10) Chat API - Spaces Delete Admin
```
Added `use_chat_admin_access` Boolean variable to `gam.cfg`.
```
* When False, GAM uses user access when making all Chat API calls. For calls that support admin access,
this can be overridden with the asadmin command line option.
* When True, GAM uses admin access for Chat API calls that support admin access; other calls will use user access.
* Default: False
```
Google requires that you have a Chat Bot configured in order to use the Chat API; set up a Chat Bot as described in the next section.
## Set up a Chat Bot
GAM is capable of acting as a Chat Bot and sending messages to Chat Rooms or direct messages to users.
Even if you're not going to use GAM as a Chat Bot, you have to configure a Chat Bot as it is required by the Chat API in [Users - Chat](Users-Chat).
* Run the command `gam setup chat`; it will point you to a URL to configure your Chat Bot.
* Enter an App name and Description of your choosing.
* For the Avatar URL you can use `https://dummyimage.com/384x256/4d4d4d/0011ff.png&text=+GAM` or a public URL to an image of your own choosing.
* In Functionality, uncheck both "Receive 1:1 messages" and "Join spaces and group conversations"
* In Connection settings, choose "Cloud Pub/Sub" and enter `projects/<ProjectID>/topics/no-topic` for the Topic Name. Replace `<ProjectID>` with your GAM project ID. GAM doesn't yet listen to pub/sub so this option is not used.
* In Visibility, uncheck "Make this Chat app available to specific people and groups in Domain Workspace".
* Click Save.
## API documentation
* https://developers.google.com/chat/concepts
* https://developers.google.com/chat/reference/rest
@@ -102,19 +139,6 @@
<ChatMessageFieldNameList> ::= "<ChatMessageFieldName>(,<ChatMessageFieldName>)*"
```
## Set up a Chat Bot
Since GAM 6.04.00, GAM is capable of acting as a Chat Bot and sending messages to Chat Rooms or direct messages to users. You first need to configure your Chat Bot.
* Run the command `gam setup chat`; it will point you to a URL to configure your Chat Bot.
* Enter an App name and Description of your choosing.
* For the Avatar URL you can use `https://dummyimage.com/384x256/4d4d4d/0011ff.png&text=+GAM` or a public URL to an image of your own choosing.
* In Functionality, uncheck both "Receive 1:1 messages" and "Join spaces and group conversations"
* In Connection settings, choose "Cloud Pub/Sub" and enter `projects/<ProjectID>/topics/no-topic` for the topic name. Replace `<ProjectID>` with your GAM project ID. GAM doesn't yet listen to pub/sub so this option is not used.
* In Visibility, uncheck "Make this Chat app available to specific people and groups in Domain Workspace".
* Click Save.
----
## Display Rooms and Chats to which your Bot belongs
Display the spaces to which your Chat Bot can send messages.
A space can be a direct message to a user, a chat group or a chat room.

View File

@@ -106,12 +106,14 @@ The second form is backwards compatible with Legacy GAM and selection with `<CrO
autoupdatethrough|
backlightinfo|
bootmode|
chromeostype|
cpuinfo|
cpustatusreports|
deprovisionreason|
devicefiles|
deviceid|
devicelicensetype|
diskspaceusage|
diskvolumereports|
dockmacaddress|
ethernetmacaddress|
@@ -119,6 +121,7 @@ The second form is backwards compatible with Legacy GAM and selection with `<CrO
extendedsupporteligible|
extendedsupportstart|
extendedsupportenabled|
faninfo|
firmwareversion|
firstenrollmenttime|
lastdeprovisiontimestamp|

View File

@@ -10,6 +10,38 @@ 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.07.16
Added `chromeostype`, `diskspaceusage` and `faninfo` to `<CrOSFieldName>` for use in `gam info|print cros`.
Fixed bugs/cleaned output in `gam info|print cros`.
### 7.07.15
Added option `shareddrivesoption included|included_if_account_is_not_a_member|not_included` to `gam create vaultexport`.
The previous option `includeshareddrives <Boolean>` is mapped as follows:
* `includeshareddrives false` - `shareddrivesoption included_if_account_is_not_a_member`
* `includeshareddrives true` - `shareddrivesoption included`
### 7.07.14
Update `gam setup chat` output to include the following that shows the actual Cloud Pub/Sub Topic Name.
```
You'll use projects/<ProjectID>/topics/no-topic in Connection settings Cloud Pub/Sub Topic Name
```
### 7.07.13
Added option `showitemcountonly` to `gam [<UserTypeEntity>] print|show shareddrives` that causes GAM to display the
number of Shared Drives on stdout; no CSV file is written.
### 7.07.12
Fixed bug in `gam print|show oushareddrives` that caused a trap.
Improved getting Shared Drive names from IDs when accessing Shared Drives in external workspaces.
### 7.07.11
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`

View File

@@ -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
GAM 7.07.11 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.16 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.5 x86_64
@@ -989,7 +989,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.07.11 - https://github.com/GAM-team/GAM - pythonsource
GAM 7.07.16 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
Windows-10-10.0.17134 AMD64

View File

@@ -12,8 +12,9 @@
- [Delete a Shared Drive](#delete-a-shared-drive)
- [Change Shared Drive visibility](#change-shared-drive-visibility)
- [Display Shared Drives](#display-shared-drives)
- [Display List of Shared Drives in an Organizational Unit other than /](#display-list-of-shared-drives-in-an-organizational-unit-other-than-)
- [Display Shared Drive Counts](#display-shared-drive-counts)
- [Display List of Shared Drives in an Organizational Unit](#display-list-of-shared-drives-in-an-organizational-unit)
- [Display Count of Shared Drives in an Organizational Unit](#display-count-of-shared-drives-in-an-organizational-unit)
- [Display all Shared Drives with no members](#display-all-shared-drives-with-no-members)
- [Display all Shared Drives with no organizers](#display-all-shared-drives-with-no-organizers)
- [Display all Shared Drives with a specific organizer](#display-all-shared-drives-with-a-specific-organizer)
@@ -416,6 +417,36 @@ gam print teamdrives query "memberCount = 0"
gam print teamdrives query "organizerCount = 0"
```
## Display Shared Drive Counts
Display the number of Shared Drives.
```
gam [<UserTypeEntity>] show|print shareddrives
[adminaccess|asadmin] [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
showitemcountonly
```
By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives:
* `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern.
* `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
Example
```
$ gam print shareddrives showitemcountonly
Getting all Shared Drives, may take some time on a large Google Workspace Account...
Got 12 Shared Drives...
12
```
The `Getting` and `Got` messages are written to stderr, the count is writtem to stdout.
To retrieve the count with `showitemcountonly`:
```
Linux/MacOS
count=$(gam print shareddrives showitemcountonly)
Windows PowerShell
count = & gam print shareddrives showitemcountonly
```
## Display all Shared Drives with a specific organizer
Substitute actual email address for `organizer@domain.com`.
```
@@ -428,18 +459,9 @@ Substitute actual email address for `organizer@domain.com`.
gam config csv_output_header_filter "id,name" print teamdriveacls pm emailaddress organizer@domain.com role organizer em pma skip pmselect
```
## Display List of Shared Drives in an Organizational Unit other than /
Get the orgUnitID of OU / and use it (without the id:) in the print|show command. Adjust fields as desired.
```
gam info ou / nousers
gam show teamdrives query "orgUnitId!='00gjdgxs2p9cxyz'" fields id,name,orgunit,createdtime
gam print teamdrives query "orgUnitId!='00gjdgxs2p9cxyz'" fields id,name,orgunit,createdtime
```
## Display List of Shared Drives in an Organizational Unit
Get the orgUnitID of the desired OU and use it (without the id:) in the print|show command. Adjust fields as desired.
```
gam info ou <OrgUnitPath> nousers
gam show teamdrives query "orgUnitId='03ph8a2z21rexy'" fields id,name,orgunit,createdtime
gam print teamdrives query "orgUnitId='03ph8a2z21rexy'" fields id,name,orgunit,createdtime
```
@@ -453,6 +475,31 @@ gam print oushareddrives [todrive <ToDriveAttribute>*]
[formatjson [quotechar <Character>]]
```
## Display Count of Shared Drives in an Organizational Unit
```
gam print|show oushareddrives
[ou|org|orgunit <OrgUnitPath>]
showitemcountonly
```
`<OrgUnitPath>` defaults to `"/"`.
Example
```
$ gam print oushareddrives showitemcountonly
Getting all Shared Drives for /, may take some time on a large Organizational Unit...
Got 9 Shared Drives for /...
9
```
The `Getting` and `Got` messages are written to stderr, the count is writtem to stdout.
To retrieve the count with `showitemcountonly`:
```
Linux/MacOS
count=$(gam print oushareddrives showitemcountonly)
Windows PowerShell
count = & gam print oushareddrives showitemcountonly
```
## Manage Shared Drive access
These commands are used to manage the ACLs on Shared Drives themselves, not the files/folders on the Shared Drives.

View File

@@ -15,8 +15,6 @@
- [Bulk Operations](#bulk-operations)
## Introduction
These features were added in version 6.60.00.
To use these commands you must update your service account authorization.
```
gam user user@domain.com update serviceaccount
@@ -46,8 +44,8 @@ Google requires that you have a Chat Bot configured in order to use the Chat API
* Enter an App name and Description of your choosing.
* For the Avatar URL you can use `https://dummyimage.com/384x256/4d4d4d/0011ff.png&text=+GAM` or a public URL to an image of your own choosing.
* In Functionality, uncheck both "Receive 1:1 messages" and "Join spaces and group conversations"
* In Connection settings, choose "Cloud Pub/Sub" and enter `projects/<ProjectID>/topics/no-topic` for the topic name. Replace `<ProjectID>` with your GAM project ID. GAM doesn't yet listen to pub/sub so this option is not used.
* In Visibility, uncheck "Make this Chat app available to specific people and groups in Domain Workspace".
* In Connection settings, choose "Cloud Pub/Sub" and enter `projects/<ProjectID>/topics/no-topic` for the Topic Name. Replace `<ProjectID>` with your GAM project ID. GAM doesn't yet listen to pub/sub so this option is not used.
* In Visibility, uncheck "Make this Chat app available to specific people and groups in Domain Workspace".
* Click Save.
## API documentation

View File

@@ -662,7 +662,7 @@ When moving a folder you can use the `retainsourcefolders` option to cause GAM t
Moving a Drive folder to a Shared Drive is not directly supported by the API; GAM has to make a copy of the folder on the Shared Drive and
recursively adjust the files/folders within it to point to the new parent folder. Once the original folder is emptied, it is deleted unless `retainsourcefolders` is specified.
### Move content of a Shared Drive to another Shared Drive
## Move content of a Shared Drive to another Shared Drive
Suppose you have a source Shared Drive with ID 0AC_1AB with multiple files and folders, and want to move all of its content to the target Shared Drive with ID 0AE_9ZX.
The following command will change the parents of the top level files and folders from 0AC_1AB to 0AE_9ZX; the sub files and folders will move along with their top level folder.
@@ -676,3 +676,19 @@ If you want the source Shared Drive with ID 0AC_1AB to be contained in a top lev
```
gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX
```
### Inter-workspace moves
Due to a restructuring, you want to move data from Shared Drive A in domaina.com to Shared Drive B in domainb.com.
* Shared Drive A in domaina.com has the following unchecked: `Allow people outside of Domain A to access files`
* Shared Drive B in domainb.com has the following checked: `Allow people outside of Domain B to access files`
* `user@domaina.com` is a manager of both Shared Drives.
```
$ gam user user@domaina move drivefile teamdriveid <SharedDriveAID> teamdriveparentid <SharedDriveBID> mergewithparent
User: user@domaina.com, Move 1 Drive File/Folder
User: user@domaina.com, Drive Folder: Shared Drive A(<SharedDriveAID>), Move(Merge) contents with Drive Folder: Shared Drive B(<SharedDriveBID>)
User: user@domaina.com, Drive File: Filename(<FileID>), Move Failed: Bad Request. User message: "shareOutNotPermitted"
...
User: user@domaina.com, Drive Folder: Shared Drive A(<SharedDriveAID>), Retained
```
To get this to work, you must check `Allow people outside of Domain A to access files` on Shared Drive A in domaina.com

View File

@@ -7,6 +7,7 @@
- [Manage file permissions/sharing](#manage-file-permissionssharing)
- [Display file permissions/sharing](#display-file-permissionssharing)
- [Delete all ACLs except owner from a file](#delete-all-acls-except-owner-from-a-file)
- [Delete all ACLs except owner from a user's My Drive](#delete-all-acls-except-owner-from-a-users-my-drive)
- [Change shares to User1 to shares to User2](#change-shares-to-user1-to-shares-to-user2)
- [Map All ACLs from an old domain to a new domain](#map-all-acls-from-an-old-domain-to-a-new-domain)
@@ -318,13 +319,23 @@ gam redirect csv ./TeamDriveACLs.csv multiprocess csv ./TeamDrives.csv gam print
## Delete all ACLs except owner from a file
Get the current ACLs.
```
gam redirect csv ./Permissions.csv user <UserItem> print drivefileacls <DriveFileID> oneitemperrow
gam redirect csv ./Permissions.csv user user@domain.com print drivefileacls <DriveFileID> oneitemperrow
```
Inspect Permissions.csv, verify that you want to proceed.
```
gam config csv_input_row_drop_filter "permission.role:regex:(owner)|(organizer)" csv ./Permissions.csv gam user "~Owner" delete drivefileacl "~id" "id:~~permission.id~~"
```
## Delete all ACLs except owner from a user's My Drive
Get the current ACLs.
```
gam redirect csv ./Permissions.csv user user@domain.com print filelist fields id,name,mimetype,basicpermissions pm not role owner em pmfilter oneitemperrow
```
Inspect Permissions.csv, verify that you want to proceed.
```
gam redirect stdout ./DeletePermissions.txt multiprocess redirect stderr stdout csv Permissions.csv.csv gam user "~Owner" delete drivefileacls "~id" "id:~~permission.id~~"
```
## Change shares to User1 to shares to User2
```
# Get files shared to User1

View File

@@ -11,6 +11,7 @@
- [Delete a Shared Drive](#delete-a-shared-drive)
- [Change Shared Drive visibility](#change-shared-drive-visibility)
- [Display Shared Drives](#display-shared-drives)
- [Display Shared Drive Counts](#display-shared-drive-counts)
- [Manage Shared Drive access](#manage-shared-drive-access)
- [Display Shared Drive access](#display-shared-drive-access)
- [Display Shared Drive access for specific Shared Drives](#display-shared-drive-access-for-specific-shared-drives)
@@ -356,6 +357,35 @@ When using the `formatjson` option, double quotes are used extensively in the da
The `quotechar <Character>` 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.
## Display Shared Drive Counts
Display the number of Shared Drives.
```
gam <UserTypeEntity> show|print shareddrives
[teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
showitemcountonly
```
By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives:
* `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern.
* `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
Example
```
$ gam user user@domain.com print shareddrives showitemcountonly
Getting all Shared Drives for user@domain.com
Got 4 Shared Drives for user@domain.com ...
4
```
The `Getting` and `Got` messages are written to stderr, the count is writtem to stdout.
To retrieve the count with `showitemcountonly`:
```
Linux/MacOS
count=$(gam user user@domain.com print shareddrives showitemcountonly)
Windows PowerShell
count = & gam user user@domain.com print shareddrives showitemcountonly
```
## Manage Shared Drive access
These commands must be issued by a user with Shared Drive permission role organizer.
### Process single ACLs.

View File

@@ -243,7 +243,8 @@ gam create vaultexport|export matter <MatterItem> [name <String>] corpus calenda
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>]
[locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
[responsestatuses <AttendeeStatus>(,<AttendeeStatus>)*] [calendarversiondate <Date>|<Time>]
[includeshareddrives <Boolean>] [driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
[(includeshareddrives <Boolean>)|(shareddrivesoption included|included_if_account_is_not_a_member|not_included)]
[driveversiondate <Date>|<Time>] [includeaccessinfo <Boolean>]
[driveclientsideencryption any|encrypted|unencrypted]
[includerooms <Boolean>]
[excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
@@ -315,8 +316,11 @@ For `corpus calendar`, you can specify the format of the exported data:
For `corpus drive`, you can specify advanced search options:
* `driveversiondate <Date>|<Time>` - Search the versions of the Drive file as of the reference date. These timestamps are in GMT and rounded down to the given date.
* `includeshareddrives False` - Do not include Shared Drives in the search, this is the default.
* `includeshareddrives True` - Include Shared Drives in the search.
* `includeshareddrives False` - Mapped to `sharedrivesoption included_if_account_is_not_a_member`
* `includeshareddrives True` - Mapped to `sharedrivesoption included`
* `sharedrivesoption included` - Resources in shared drives are included in the search
* `sharedrivesoption included_if_account_is_not_a_member` - Resources in shared drives where account is not a member are included in the search, this is the default
* `sharedrivesoption not_included` - Resources in shared drives are not included in the search
* `driveclientsideencryption any` - Include both client-side encrypted and unencrypted content in search, this is the default.
* `driveclientsideencryption encrypted` - Include client-side encrypted content only in search.
* `driveclientsideencryption unencrypted` - Include client-side unencrypted content only in search.
@@ -599,7 +603,7 @@ gam create vaulthold|hold matter <MatterItem> [name <String>] corpus calendar|dr
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
[includerooms <Boolean>]
[covereddata calllogs|textmessages|voicemails]
[includeshareddrives|includeteamdrives <Boolean>]
[includeshareddrives <Boolean>]
[showdetails|returnidonly]
```
Specify the name of the hold:
@@ -621,8 +625,8 @@ Specify the search method, this option is required:
The `query <QueryVaultCorpus>` option can still be used but it is much simpler to use the following options.
For `corpus drive`, you can specify advanced search options:
* `includeshareddrives False` - Do not include Shared Drives in the search, this is the default.
* `includeshareddrives True` - Include Shared Drives in the search.
* `includeshareddrives False` - Files in shared drives are not included in the hold, this is the default
* `includeshareddrives True` - Files in shared drives are included in the hold
For `corpus mail`, you can specify search terms to limit the search.
* `terms <String>` - [Vault search](https://support.google.com/vault/answer/2474474)
@@ -652,12 +656,12 @@ gam update vaulthold|hold <HoldItem> matter <MatterItem>
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
[includerooms <Boolean>]
[covereddata calllogs|textmessages|voicemails]
[includeshareddrives|includeteamdrives <Boolean>]
[includeshareddrives <Boolean>]
[showdetails]
```
For a hold with `corpus drive`, you can specify advanced search options:
* `includeshareddrives False` - Do not include Shared Drives in the search, this is the default.
* `includeshareddrives True` - Include Shared Drives in the search.
* `includeshareddrives False` - Files in shared drives are not included in the hold, this is the default
* `includeshareddrives True` - Files in shared drives are included in the hold
For a hold with `corpus mail`, you can specify search terms to limit the search.
* `terms <String>` - [Vault search](https://support.google.com/vault/answer/2474474)

View File

@@ -3,7 +3,7 @@
Print the current version of Gam with details
```
gam version
GAM 7.07.11 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.16 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.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
GAM 7.07.11 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.16 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.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
GAM 7.07.11 - https://github.com/GAM-team/GAM - pyinstaller
GAM 7.07.16 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.5 x86_64
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gam7
Version Check:
Current: 5.35.08
Latest: 7.07.11
Latest: 7.07.16
echo $?
1
```
@@ -72,7 +72,7 @@ echo $?
Print the current version number without details
```
gam version simple
7.07.11
7.07.16
```
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 7.07.11 - https://github.com/GAM-team/GAM
GAM 7.07.16 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com>
Python 3.13.3 64-bit final
MacOS Sequoia 15.5 x86_64