mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 12:21:35 +00:00
Compare commits
17 Commits
v7.07.12
...
20250528.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e636a69431 | ||
|
|
673460e91d | ||
|
|
9862ad446f | ||
|
|
67f21ce650 | ||
|
|
e82baccbac | ||
|
|
c51b06a6c3 | ||
|
|
b7415cd63f | ||
|
|
f0f5803698 | ||
|
|
575fdea526 | ||
|
|
f8ee94bad8 | ||
|
|
4b6c8fb518 | ||
|
|
4f8c80dcab | ||
|
|
12f5c5e670 | ||
|
|
a1216b6782 | ||
|
|
05f4795bc3 | ||
|
|
e1ff1ba378 | ||
|
|
5b2804643e |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -449,7 +449,7 @@ jobs:
|
|||||||
"$PYTHON" get-pip.py
|
"$PYTHON" get-pip.py
|
||||||
"$PYTHON" -m pip install --upgrade pip
|
"$PYTHON" -m pip install --upgrade pip
|
||||||
"$PYTHON" -m pip install --upgrade wheel
|
"$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 importlib-metadata
|
||||||
"$PYTHON" -m pip install --upgrade setuptools-scm
|
"$PYTHON" -m pip install --upgrade setuptools-scm
|
||||||
"$PYTHON" -m pip list
|
"$PYTHON" -m pip list
|
||||||
|
|||||||
@@ -21,8 +21,8 @@ dependencies = [
|
|||||||
"lxml>=5.4.0",
|
"lxml>=5.4.0",
|
||||||
"passlib>=1.7.4",
|
"passlib>=1.7.4",
|
||||||
"pathvalidate>=3.2.3",
|
"pathvalidate>=3.2.3",
|
||||||
"pyscard==2.2.1",
|
|
||||||
"python-dateutil",
|
"python-dateutil",
|
||||||
|
"yubikey-manager>=5.6.1",
|
||||||
]
|
]
|
||||||
description = "CLI tool to manage Google Workspace"
|
description = "CLI tool to manage Google Workspace"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -5260,7 +5260,8 @@ gam create vaultexport|export matter <MatterItem> [name <String>] corpus calenda
|
|||||||
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>]
|
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>]
|
||||||
[locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
|
[locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
|
||||||
[responsestatuses <AttendeeStatus>(,<AttendeeStatus>)*] [calendarversiondate <Date>|<Time>]
|
[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]
|
[driveclientsideencryption any|encrypted|unencrypted]
|
||||||
[includerooms <Boolean>]
|
[includerooms <Boolean>]
|
||||||
[excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
|
[excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
|
||||||
@@ -5326,14 +5327,14 @@ gam create vaulthold|hold matter <MatterItem> [name <String>] corpus calendar|dr
|
|||||||
[query <QueryVaultCorpus>]
|
[query <QueryVaultCorpus>]
|
||||||
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
||||||
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
|
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
|
||||||
[includeshareddrives|includeteamdrives <Boolean>]
|
[includeshareddrives <Boolean>]
|
||||||
[showdetails|returnidonly]
|
[showdetails|returnidonly]
|
||||||
gam update vaulthold|hold <HoldItem> matter <MatterItem>
|
gam update vaulthold|hold <HoldItem> matter <MatterItem>
|
||||||
[([addaccounts|addgroups|addusers <EmailItemList>] [removeaccounts|removegroups|removeusers <EmailItemList>]) | (orgunit|org|ou <OrgUnit>)]
|
[([addaccounts|addgroups|addusers <EmailItemList>] [removeaccounts|removegroups|removeusers <EmailItemList>]) | (orgunit|org|ou <OrgUnit>)]
|
||||||
[query <QueryVaultCorpus>]
|
[query <QueryVaultCorpus>]
|
||||||
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
[terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
||||||
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
|
[includerooms <Boolean>] [covereddata calllogs|textmessages|voicemails]
|
||||||
[includeshareddrives|includeteamdrives <Boolean>]
|
[includeshareddrives <Boolean>]
|
||||||
[showdetails]
|
[showdetails]
|
||||||
gam delete vaulthold|hold <HoldItem> matter <MatterItem>
|
gam delete vaulthold|hold <HoldItem> matter <MatterItem>
|
||||||
gam delete vaulthold|hold <MatterItem> <HoldItem>
|
gam delete vaulthold|hold <MatterItem> <HoldItem>
|
||||||
|
|||||||
@@ -1,3 +1,23 @@
|
|||||||
|
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
|
7.07.12
|
||||||
|
|
||||||
Fixed bug in `gam print|show oushareddrives` that caused a trap.
|
Fixed bug in `gam print|show oushareddrives` that caused a trap.
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ hiddenimports = [
|
|||||||
'gam.gamlib.yubikey',
|
'gam.gamlib.yubikey',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
excludes = [
|
||||||
|
'pkg_resources',
|
||||||
|
]
|
||||||
|
|
||||||
runtime_hooks = []
|
runtime_hooks = []
|
||||||
a = Analysis(
|
a = Analysis(
|
||||||
['gam/__main__.py'],
|
['gam/__main__.py'],
|
||||||
@@ -48,7 +52,7 @@ a = Analysis(
|
|||||||
hookspath=[],
|
hookspath=[],
|
||||||
hooksconfig={},
|
hooksconfig={},
|
||||||
runtime_hooks=runtime_hooks,
|
runtime_hooks=runtime_hooks,
|
||||||
excludes=[],
|
excludes=excludes,
|
||||||
win_no_prefer_redirects=False,
|
win_no_prefer_redirects=False,
|
||||||
win_private_assemblies=False,
|
win_private_assemblies=False,
|
||||||
cipher=None,
|
cipher=None,
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.07.12'
|
__version__ = '7.07.15'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@@ -25949,7 +25949,7 @@ def _printChatItem(user, citem, parent, entityType, csvPF, FJQC, addCSVData=None
|
|||||||
def doSetupChat():
|
def doSetupChat():
|
||||||
checkForExtraneousArguments()
|
checkForExtraneousArguments()
|
||||||
_, chat , _ = buildChatServiceObject()
|
_, 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):
|
def getSpaceName(myarg):
|
||||||
if myarg == 'space':
|
if myarg == 'space':
|
||||||
@@ -40817,6 +40817,11 @@ VAULT_RESPONSE_STATUS_MAP = {
|
|||||||
'needsaction': 'ATTENDEE_RESPONSE_NEEDS_ACTION',
|
'needsaction': 'ATTENDEE_RESPONSE_NEEDS_ACTION',
|
||||||
'tentative': 'ATTENDEE_RESPONSE_TENTATIVE',
|
'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 = {
|
VAULT_VOICE_COVERED_DATA_MAP = {
|
||||||
'calllogs': 'CALL_LOGS',
|
'calllogs': 'CALL_LOGS',
|
||||||
'textmessages': 'TEXT_MESSAGES',
|
'textmessages': 'TEXT_MESSAGES',
|
||||||
@@ -40875,7 +40880,7 @@ VAULT_QUERY_ARGS = [
|
|||||||
# calendar
|
# calendar
|
||||||
'locationquery', 'peoplequery', 'minuswords', 'responsestatuses', 'caldendarversiondate',
|
'locationquery', 'peoplequery', 'minuswords', 'responsestatuses', 'caldendarversiondate',
|
||||||
# drive
|
# drive
|
||||||
'driveclientsideencryption', 'driveversiondate', 'includeshareddrives', 'includeteamdrives',
|
'driveclientsideencryption', 'driveversiondate', 'includeshareddrives', 'includeteamdrives', 'shareddrivesoption',
|
||||||
# hangoutsChat
|
# hangoutsChat
|
||||||
'includerooms',
|
'includerooms',
|
||||||
# mail
|
# mail
|
||||||
@@ -40945,7 +40950,9 @@ def _buildVaultQuery(myarg, query, corpusArgumentMap):
|
|||||||
elif myarg == 'driveversiondate':
|
elif myarg == 'driveversiondate':
|
||||||
query.setdefault('driveOptions', {})['versionDate'] = getTimeOrDeltaFromNow()
|
query.setdefault('driveOptions', {})['versionDate'] = getTimeOrDeltaFromNow()
|
||||||
elif myarg in {'includeshareddrives', 'includeteamdrives'}:
|
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':
|
elif myarg == 'driveclientsideencryption':
|
||||||
query.setdefault('driveOptions', {})['clientSideEncryptedOption'] = getChoice(VAULT_CSE_OPTION_MAP, mapChoice=True)
|
query.setdefault('driveOptions', {})['clientSideEncryptedOption'] = getChoice(VAULT_CSE_OPTION_MAP, mapChoice=True)
|
||||||
# hangoutsChat
|
# hangoutsChat
|
||||||
@@ -40979,7 +40986,8 @@ def _validateVaultQuery(body, corpusArgumentMap):
|
|||||||
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>]
|
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>] [timezone <TimeZone>]
|
||||||
# [locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
|
# [locationquery <StringList>] [peoplequery <StringList>] [minuswords <StringList>]
|
||||||
# [responsestatuses <AttendeeStatus>(,<AttendeeStatus>)*] [calendarversiondate <Date>|<Time>]
|
# [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]
|
# [driveclientsideencryption any|encrypted|unencrypted]
|
||||||
# [includerooms <Boolean>]
|
# [includerooms <Boolean>]
|
||||||
# [excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
|
# [excludedrafts <Boolean>] [mailclientsideencryption any|encrypted|unencrypted]
|
||||||
@@ -41050,7 +41058,7 @@ def doCreateVaultExport():
|
|||||||
try:
|
try:
|
||||||
export = callGAPI(v.matters().exports(), 'create',
|
export = callGAPI(v.matters().exports(), 'create',
|
||||||
throwReasons=[GAPI.ALREADY_EXISTS, GAPI.BAD_REQUEST, GAPI.BACKEND_ERROR, GAPI.INVALID_ARGUMENT,
|
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)
|
matterId=matterId, body=body)
|
||||||
if not returnIdOnly:
|
if not returnIdOnly:
|
||||||
entityActionPerformed([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_EXPORT, formatVaultNameId(export['name'], export['id'])])
|
entityActionPerformed([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_EXPORT, formatVaultNameId(export['name'], export['id'])])
|
||||||
@@ -41059,7 +41067,7 @@ def doCreateVaultExport():
|
|||||||
else:
|
else:
|
||||||
writeStdout(f'{export["id"]}\n')
|
writeStdout(f'{export["id"]}\n')
|
||||||
except (GAPI.alreadyExists, GAPI.badRequest, GAPI.backendError, GAPI.invalidArgument,
|
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))
|
entityActionFailedWarning([Ent.VAULT_MATTER, matterNameId, Ent.VAULT_EXPORT, body.get('name')], str(e))
|
||||||
|
|
||||||
# gam delete vaultexport|export <ExportItem> matter <MatterItem>
|
# gam delete vaultexport|export <ExportItem> matter <MatterItem>
|
||||||
@@ -41573,7 +41581,7 @@ def _setHoldQuery(body, queryParameters):
|
|||||||
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
||||||
# [includerooms <Boolean>]
|
# [includerooms <Boolean>]
|
||||||
# [covereddata calllogs|textmessages|voicemails]
|
# [covereddata calllogs|textmessages|voicemails]
|
||||||
# [includeshareddrives|includeteamdrives <Boolean>]
|
# [includeshareddrives <Boolean>]
|
||||||
# [showdetails|returnidonly]
|
# [showdetails|returnidonly]
|
||||||
def doCreateVaultHold():
|
def doCreateVaultHold():
|
||||||
v = buildGAPIObject(API.VAULT)
|
v = buildGAPIObject(API.VAULT)
|
||||||
@@ -41639,7 +41647,7 @@ def doCreateVaultHold():
|
|||||||
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
# [terms <String>] [start|starttime <Date>|<Time>] [end|endtime <Date>|<Time>]
|
||||||
# [includerooms <Boolean>]
|
# [includerooms <Boolean>]
|
||||||
# [covereddata calllogs|textmessages|voicemails]
|
# [covereddata calllogs|textmessages|voicemails]
|
||||||
# [includeshareddrives|includeteamdrives <Boolean>]
|
# [includeshareddrives <Boolean>]
|
||||||
# [showdetails]
|
# [showdetails]
|
||||||
def doUpdateVaultHold():
|
def doUpdateVaultHold():
|
||||||
v = buildGAPIObject(API.VAULT)
|
v = buildGAPIObject(API.VAULT)
|
||||||
@@ -59838,6 +59846,7 @@ def copyDriveFile(users):
|
|||||||
# Source at root of Shared Drive?
|
# Source at root of Shared Drive?
|
||||||
sourceMimeType = source['mimeType']
|
sourceMimeType = source['mimeType']
|
||||||
if sourceMimeType == MIMETYPE_GA_FOLDER and source.get('driveId') and source['name'] == TEAM_DRIVE and not source.get('parents', []):
|
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'])
|
source['name'] = _getSharedDriveNameFromId(drive, source['driveId'])
|
||||||
sourceName = source['name']
|
sourceName = source['name']
|
||||||
sourceNameId = f"{sourceName}({source['id']})"
|
sourceNameId = f"{sourceName}({source['id']})"
|
||||||
@@ -65416,12 +65425,14 @@ SHAREDDRIVE_ACL_ROLES_MAP = {
|
|||||||
# (role|roles <SharedDriveACLRoleList>)*
|
# (role|roles <SharedDriveACLRoleList>)*
|
||||||
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
|
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
|
||||||
# [guiroles [<Boolean>]] [formatjson [quotechar <Character>]]
|
# [guiroles [<Boolean>]] [formatjson [quotechar <Character>]]
|
||||||
|
# [showitemcountonly]
|
||||||
# gam <UserTypeEntity> show shareddrives
|
# gam <UserTypeEntity> show shareddrives
|
||||||
# [asadmin [shareddriveadminquery|query <QuerySharedDrive>]]
|
# [asadmin [shareddriveadminquery|query <QuerySharedDrive>]]
|
||||||
# [matchname <REMatchPattrn>] [orgunit|org|ou <OrgUnitPath>]
|
# [matchname <REMatchPattrn>] [orgunit|org|ou <OrgUnitPath>]
|
||||||
# (role|roles <SharedDriveACLRoleLIst>)*
|
# (role|roles <SharedDriveACLRoleLIst>)*
|
||||||
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
|
# [fields <SharedDriveFieldNameList>] [noorgunits [<Boolean>]]
|
||||||
# [guiroles [<Boolean>]] [formatjson]
|
# [guiroles [<Boolean>]] [formatjson]
|
||||||
|
# [showitemcountonly]
|
||||||
def printShowSharedDrives(users, useDomainAdminAccess=False):
|
def printShowSharedDrives(users, useDomainAdminAccess=False):
|
||||||
def stripNonShowFields(shareddrive):
|
def stripNonShowFields(shareddrive):
|
||||||
if orgUnitIdToPathMap:
|
if orgUnitIdToPathMap:
|
||||||
@@ -65445,7 +65456,7 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
|
|||||||
SHAREDDRIVE_FIELDS_CHOICE_MAP.update(SHAREDDRIVE_LIST_FIELDS_CHOICE_MAP)
|
SHAREDDRIVE_FIELDS_CHOICE_MAP.update(SHAREDDRIVE_LIST_FIELDS_CHOICE_MAP)
|
||||||
showOrgUnitPaths = True
|
showOrgUnitPaths = True
|
||||||
orgUnitIdToPathMap = None
|
orgUnitIdToPathMap = None
|
||||||
guiRoles = False
|
guiRoles = showItemCountOnly = False
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if csvPF and myarg == 'todrive':
|
if csvPF and myarg == 'todrive':
|
||||||
@@ -65475,6 +65486,9 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
|
|||||||
showOrgUnitPaths = not getBoolean()
|
showOrgUnitPaths = not getBoolean()
|
||||||
elif myarg == 'guiroles':
|
elif myarg == 'guiroles':
|
||||||
guiRoles = getBoolean()
|
guiRoles = getBoolean()
|
||||||
|
elif myarg == 'showitemcountonly':
|
||||||
|
showItemCountOnly = True
|
||||||
|
showOrgUnitPaths = False
|
||||||
else:
|
else:
|
||||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||||
if query and not useDomainAdminAccess:
|
if query and not useDomainAdminAccess:
|
||||||
@@ -65544,6 +65558,9 @@ def printShowSharedDrives(users, useDomainAdminAccess=False):
|
|||||||
jcount = len(matchedFeed)
|
jcount = len(matchedFeed)
|
||||||
if jcount == 0:
|
if jcount == 0:
|
||||||
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
||||||
|
if showItemCountOnly:
|
||||||
|
writeStdout(f'{jcount}\n')
|
||||||
|
return
|
||||||
if not csvPF:
|
if not csvPF:
|
||||||
if not FJQC.formatJSON:
|
if not FJQC.formatJSON:
|
||||||
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count)
|
entityPerformActionNumItems([Ent.USER, user], jcount, Ent.SHAREDDRIVE, i, count)
|
||||||
@@ -65574,9 +65591,11 @@ def doPrintShowSharedDrives():
|
|||||||
# gam print oushareddrives [todrive <ToDriveAttribute>*]
|
# gam print oushareddrives [todrive <ToDriveAttribute>*]
|
||||||
# [ou|org|orgunit <OrgUnitPath>]
|
# [ou|org|orgunit <OrgUnitPath>]
|
||||||
# [formatjson [quotechar <Character>]]
|
# [formatjson [quotechar <Character>]]
|
||||||
|
# [showitemcountonly]
|
||||||
# gam show oushareddrives
|
# gam show oushareddrives
|
||||||
# [ou|org|orgunit <OrgUnitPath>]
|
# [ou|org|orgunit <OrgUnitPath>]
|
||||||
# [formatjson]
|
# [formatjson]
|
||||||
|
# [showitemcountonly]
|
||||||
def doPrintShowOrgunitSharedDrives():
|
def doPrintShowOrgunitSharedDrives():
|
||||||
def _getOrgUnitSharedDriveInfo(shareddrive):
|
def _getOrgUnitSharedDriveInfo(shareddrive):
|
||||||
shareddrive['driveId'] = shareddrive['name'].rsplit(';')[1]
|
shareddrive['driveId'] = shareddrive['name'].rsplit(';')[1]
|
||||||
@@ -65605,12 +65624,15 @@ def doPrintShowOrgunitSharedDrives():
|
|||||||
csvPF = CSVPrintFile(['name', 'type', 'member', 'memberUri', 'driveId', 'driveName', 'orgUnitPath']) if Act.csvFormat() else None
|
csvPF = CSVPrintFile(['name', 'type', 'member', 'memberUri', 'driveId', 'driveName', 'orgUnitPath']) if Act.csvFormat() else None
|
||||||
FJQC = FormatJSONQuoteChar(csvPF)
|
FJQC = FormatJSONQuoteChar(csvPF)
|
||||||
orgUnitPath = '/'
|
orgUnitPath = '/'
|
||||||
|
showItemCountOnly = False
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if csvPF and myarg == 'todrive':
|
if csvPF and myarg == 'todrive':
|
||||||
csvPF.GetTodriveParameters()
|
csvPF.GetTodriveParameters()
|
||||||
elif myarg in {'ou', 'org', 'orgunit'}:
|
elif myarg in {'ou', 'org', 'orgunit'}:
|
||||||
orgUnitPath = getString(Cmd.OB_ORGUNIT_ITEM)
|
orgUnitPath = getString(Cmd.OB_ORGUNIT_ITEM)
|
||||||
|
elif myarg == 'showitemcountonly':
|
||||||
|
showItemCountOnly = True
|
||||||
else:
|
else:
|
||||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||||
if csvPF and FJQC.formatJSON:
|
if csvPF and FJQC.formatJSON:
|
||||||
@@ -65625,6 +65647,9 @@ def doPrintShowOrgunitSharedDrives():
|
|||||||
jcount = len(sds)
|
jcount = len(sds)
|
||||||
if jcount == 0:
|
if jcount == 0:
|
||||||
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
setSysExitRC(NO_ENTITIES_FOUND_RC)
|
||||||
|
if showItemCountOnly:
|
||||||
|
writeStdout(f'{jcount}\n')
|
||||||
|
return
|
||||||
if not csvPF:
|
if not csvPF:
|
||||||
if not FJQC.formatJSON:
|
if not FJQC.formatJSON:
|
||||||
entityPerformActionNumItems([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], jcount, Ent.SHAREDDRIVE)
|
entityPerformActionNumItems([Ent.ORGANIZATIONAL_UNIT, orgUnitPath], jcount, Ent.SHAREDDRIVE)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
# Copyright (C) 2024 Ross Scroggs All Rights Reserved.
|
# Copyright (C) 2025 Ross Scroggs All Rights Reserved.
|
||||||
#
|
#
|
||||||
# All Rights Reserved.
|
# All Rights Reserved.
|
||||||
#
|
#
|
||||||
@@ -504,13 +504,15 @@ TO = 'To'
|
|||||||
TO_LC = 'to'
|
TO_LC = 'to'
|
||||||
TO_MAXIMUM_OF = 'to maximum of'
|
TO_MAXIMUM_OF = 'to maximum of'
|
||||||
TO_SET_UP_GOOGLE_CHAT = """
|
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}
|
{0}
|
||||||
|
|
||||||
and follow the instructions at:
|
and follow the instructions at:
|
||||||
|
|
||||||
https://github.com/GAM-team/GAM/wiki/Chat-Bot#set-up-a-chat-bot
|
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}'
|
TOTAL_ITEMS_IN_ENTITY = 'Total {0} in {1}'
|
||||||
TRIMMED_MESSAGE_FROM_LENGTH_TO_MAXIMUM = 'Trimmed message of length {0} to maximum length {1}'
|
TRIMMED_MESSAGE_FROM_LENGTH_TO_MAXIMUM = 'Trimmed message of length {0} to maximum length {1}'
|
||||||
|
|||||||
@@ -10,6 +10,5 @@ httplib2>=0.22.0
|
|||||||
lxml>=5.4.0
|
lxml>=5.4.0
|
||||||
passlib>=1.7.4
|
passlib>=1.7.4
|
||||||
pathvalidate>=3.2.3
|
pathvalidate>=3.2.3
|
||||||
pyscard==2.2.1
|
|
||||||
python-dateutil
|
python-dateutil
|
||||||
yubikey-manager>=5.6.1
|
yubikey-manager>=5.6.1
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ install_requires =
|
|||||||
lxml >= 5.4.0
|
lxml >= 5.4.0
|
||||||
passlib >= 1.7.4
|
passlib >= 1.7.4
|
||||||
pathvalidate >= 3.2.3
|
pathvalidate >= 3.2.3
|
||||||
pyscard == 2.2.1
|
|
||||||
python-dateutil
|
python-dateutil
|
||||||
yubikey-manager >= 5.6.1
|
yubikey-manager >= 5.6.1
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Chat Bot
|
# Chat Bot
|
||||||
|
- [Introduction](#introduction)
|
||||||
|
- [Set up a Chat Bot](#set-up-a-chat-bot)
|
||||||
- [API documentation](#api-documentation)
|
- [API documentation](#api-documentation)
|
||||||
- [Definitions](#definitions)
|
- [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 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)
|
- [Display Members of a Room or Chat](#display-members-of-a-room-or-chat)
|
||||||
- [Create a Chat Message](#create-a-chat-message)
|
- [Create a Chat Message](#create-a-chat-message)
|
||||||
@@ -10,6 +10,43 @@
|
|||||||
- [Delete a Chat Message](#delete-a-chat-message)
|
- [Delete a Chat Message](#delete-a-chat-message)
|
||||||
- [Display a Chat Message](#display-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
|
## API documentation
|
||||||
* https://developers.google.com/chat/concepts
|
* https://developers.google.com/chat/concepts
|
||||||
* https://developers.google.com/chat/reference/rest
|
* https://developers.google.com/chat/reference/rest
|
||||||
@@ -102,19 +139,6 @@
|
|||||||
<ChatMessageFieldNameList> ::= "<ChatMessageFieldName>(,<ChatMessageFieldName>)*"
|
<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 Rooms and Chats to which your Bot belongs
|
||||||
Display the spaces to which your Chat Bot can send messages.
|
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.
|
A space can be a direct message to a user, a chat group or a chat room.
|
||||||
|
|||||||
@@ -10,6 +10,24 @@ 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
|
See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 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
|
### 7.07.11
|
||||||
|
|
||||||
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
Updated `gam calendars <CalendarEntity> update events` and `gam <UserTypeEntity> update events <UserCalendarEntity>`
|
||||||
|
|||||||
@@ -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$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin$ gam version
|
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
|
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.14 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
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:\>del C:\GAMConfig\oauth2.txt
|
||||||
C:\>gam version
|
C:\>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
|
||||||
GAM 7.07.11 - https://github.com/GAM-team/GAM - pythonsource
|
GAM 7.07.14 - https://github.com/GAM-team/GAM - pythonsource
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
|||||||
@@ -12,8 +12,9 @@
|
|||||||
- [Delete a Shared Drive](#delete-a-shared-drive)
|
- [Delete a Shared Drive](#delete-a-shared-drive)
|
||||||
- [Change Shared Drive visibility](#change-shared-drive-visibility)
|
- [Change Shared Drive visibility](#change-shared-drive-visibility)
|
||||||
- [Display Shared Drives](#display-shared-drives)
|
- [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 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 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 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)
|
- [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"
|
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
|
## Display all Shared Drives with a specific organizer
|
||||||
Substitute actual email address for `organizer@domain.com`.
|
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
|
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
|
## 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.
|
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 show teamdrives query "orgUnitId='03ph8a2z21rexy'" fields id,name,orgunit,createdtime
|
||||||
gam print 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>]]
|
[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
|
## Manage Shared Drive access
|
||||||
These commands are used to manage the ACLs on Shared Drives themselves, not the files/folders on the Shared Drives.
|
These commands are used to manage the ACLs on Shared Drives themselves, not the files/folders on the Shared Drives.
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,6 @@
|
|||||||
- [Bulk Operations](#bulk-operations)
|
- [Bulk Operations](#bulk-operations)
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
These features were added in version 6.60.00.
|
|
||||||
|
|
||||||
To use these commands you must update your service account authorization.
|
To use these commands you must update your service account authorization.
|
||||||
```
|
```
|
||||||
gam user user@domain.com update serviceaccount
|
gam user user@domain.com update serviceaccount
|
||||||
@@ -46,7 +44,7 @@ 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.
|
* 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.
|
* 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 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 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 Visibility, uncheck "Make this Chat app available to specific people and groups in Domain Workspace".
|
||||||
* Click Save.
|
* Click Save.
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
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.
|
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.
|
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.
|
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
|
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
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
- [Manage file permissions/sharing](#manage-file-permissionssharing)
|
- [Manage file permissions/sharing](#manage-file-permissionssharing)
|
||||||
- [Display file permissions/sharing](#display-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 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)
|
- [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)
|
- [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
|
## Delete all ACLs except owner from a file
|
||||||
Get the current ACLs.
|
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.
|
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~~"
|
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
|
## Change shares to User1 to shares to User2
|
||||||
```
|
```
|
||||||
# Get files shared to User1
|
# Get files shared to User1
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
- [Delete a Shared Drive](#delete-a-shared-drive)
|
- [Delete a Shared Drive](#delete-a-shared-drive)
|
||||||
- [Change Shared Drive visibility](#change-shared-drive-visibility)
|
- [Change Shared Drive visibility](#change-shared-drive-visibility)
|
||||||
- [Display Shared Drives](#display-shared-drives)
|
- [Display Shared Drives](#display-shared-drives)
|
||||||
|
- [Display Shared Drive Counts](#display-shared-drive-counts)
|
||||||
- [Manage Shared Drive access](#manage-shared-drive-access)
|
- [Manage Shared Drive access](#manage-shared-drive-access)
|
||||||
- [Display Shared Drive access](#display-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)
|
- [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.
|
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.
|
`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
|
## Manage Shared Drive access
|
||||||
These commands must be issued by a user with Shared Drive permission role organizer.
|
These commands must be issued by a user with Shared Drive permission role organizer.
|
||||||
### Process single ACLs.
|
### Process single ACLs.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAM 7.07.11 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.07.14 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
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
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAM 7.07.11 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.07.14 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
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
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAM 7.07.11 - https://github.com/GAM-team/GAM - pyinstaller
|
GAM 7.07.14 - https://github.com/GAM-team/GAM - pyinstaller
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
MacOS Sequoia 15.5 x86_64
|
||||||
@@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
|||||||
Path: /Users/Admin/bin/gam7
|
Path: /Users/Admin/bin/gam7
|
||||||
Version Check:
|
Version Check:
|
||||||
Current: 5.35.08
|
Current: 5.35.08
|
||||||
Latest: 7.07.11
|
Latest: 7.07.14
|
||||||
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
|
||||||
7.07.11
|
7.07.14
|
||||||
```
|
```
|
||||||
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 7.07.11 - https://github.com/GAM-team/GAM
|
GAM 7.07.14 - https://github.com/GAM-team/GAM
|
||||||
GAM Team <google-apps-manager@googlegroups.com>
|
GAM Team <google-apps-manager@googlegroups.com>
|
||||||
Python 3.13.3 64-bit final
|
Python 3.13.3 64-bit final
|
||||||
MacOS Sequoia 15.5 x86_64
|
MacOS Sequoia 15.5 x86_64
|
||||||
|
|||||||
Reference in New Issue
Block a user