mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-22 23:21:37 +00:00
Compare commits
8 Commits
20250713.0
...
v7.13.03
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
963cbebba0 | ||
|
|
c0edbfe596 | ||
|
|
47617c2823 | ||
|
|
11e0f1c760 | ||
|
|
6c4b481eb1 | ||
|
|
c0cbddc93d | ||
|
|
b50d92404f | ||
|
|
19408f8f4c |
@@ -685,6 +685,7 @@ If an item contains spaces, it should be surrounded by ".
|
||||
<CalendarList> ::= "<CalendarItem>(,<CalendarItem>)*"
|
||||
<ChatSpaceList> ::= "<ChatSpace>(,<ChatSpace>)*"
|
||||
<ChromeProfileNameList> ::= "<ChromeProfileName>(,<ChromeProfileName>)*"
|
||||
<ChromeProfileCommandNameList> ::= "<ChromeProfileCommandName>(,<ChromeProfileCommandName>)*"
|
||||
<CIGroupAliasList> ::= "<CIGroupAlias>(,<CIGroupAlias>)*"
|
||||
<CIGroupMemberTypeList> ::= "<CIGroupMemberType>(,<CIGroupMemberType>)*"
|
||||
<CIPolicyNameList> ::= "<CIPolicyName>(,<CIPolicyName>)*"
|
||||
@@ -2228,12 +2229,14 @@ gam show chromeneedsattn
|
||||
|
||||
<ChromeProfilePermanentID> ::= <String>
|
||||
<ChromeProfileName> ::= customers/<CustomerID>/profiles/<ChromeProfilePermanentID> | <ChromeProfilePermanentID>
|
||||
<ChromeProfileCommandName> ::= <ChomeProfileName>/commands/<String>
|
||||
<ChromeProfileNameList> ::= "<ChromeProfileName>(,<ChromeProfileName>)*"
|
||||
<ChromeProfileCommandName> ::= <ChomeProfileName>/commands/<String>
|
||||
<ChromeProfileCommandNameList> ::= "<ChromeProfileCommandName>(,<ChromeProfileCommandName>)*"
|
||||
<ChromeProfileNameEntity> ::=
|
||||
<ChromeProfileNameList> |
|
||||
(select <FileSelector>|<CSVFileSelector>) |
|
||||
(filter <String> (filtertime<String> <Time>)* [orderby <ChromeProfileOrderByFieldName> [ascending|descending]])
|
||||
(select <ChromeProfileNameList>|<FileSelector>|<CSVFileSelector>) |
|
||||
(filter <String> (filtertime<String> <Time>)* [orderby <ChromeProfileOrderByFieldName> [ascending|descending]]) |
|
||||
(commands <ChromeProfileCommandNameList>|<FileSelector>|<CSVFileSelector>)
|
||||
|
||||
<ChromeProfileFieldName> ::=
|
||||
affiliationstate|
|
||||
@@ -2297,7 +2300,7 @@ gam print chromeprofiles [todrive <ToDriveAttribute>*]
|
||||
|
||||
gam create chromeprofilecommand <ChromeProfileNameEntity>
|
||||
[clearcache [<Boolean>]] [clearcookies [<Boolean>]]
|
||||
[formatjson]
|
||||
[csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]]]
|
||||
|
||||
gam info chromeprofilecommand <ChromeProfileCommandName>
|
||||
[formatjson]
|
||||
@@ -3444,8 +3447,7 @@ gam print|show transferapps
|
||||
|
||||
<DataTransferService> ::=
|
||||
calendar|
|
||||
currents|
|
||||
datastudio|lookerstudio|"google data studio"|
|
||||
datastudio|lookerstudio|"looker studio"|
|
||||
googledrive|gdrive|drive|"drive and docs"
|
||||
<DataTransferServiceList> ::= "<DataTransferService>(,<DataTransferService>)*"
|
||||
|
||||
|
||||
@@ -1,3 +1,22 @@
|
||||
7.13.03
|
||||
|
||||
Added option `csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]]]`
|
||||
to `gam create chromeprofilecommand` so that command details are displayed in CSV format.
|
||||
|
||||
Added option `commands <ChromeProfileCommandNameList>|<FileSelector>|<CSVFileSelector>` to `<ChromeProfileNameEntity>`
|
||||
so that `gam print|show chromeprofilecommands` can directly display the commands generated by
|
||||
`gam create chromeprofilecommand` with the `csv` option.
|
||||
|
||||
7.13.02
|
||||
|
||||
Fixed bug in `gam create chromeprofilecommand` where `select|filter` were not recognized.
|
||||
|
||||
Updated `gam create datatransfer <OldOwnerID> datastudio <NewOwnerID>` that generated the following
|
||||
error due to an unhandled API change.
|
||||
```
|
||||
ERROR: Invalid choice (google data studio): Expected <calendar|looker studio|drive and docs>
|
||||
```
|
||||
|
||||
7.13.01
|
||||
|
||||
Enhanced `gam create|print|show chromeprofilecommand` to allow specification
|
||||
|
||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||
__version__ = '7.13.01'
|
||||
__version__ = '7.13.03'
|
||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@@ -17071,14 +17071,14 @@ def _convertTransferAppIDtoName(apps, appID):
|
||||
return f'applicationId: {appID}'
|
||||
|
||||
DRIVE_AND_DOCS_APP_NAME = 'drive and docs'
|
||||
GOOGLE_DATA_STUDIO_APP_NAME = 'google data studio'
|
||||
GOOGLE_LOOKER_STUDIO_APP_NAME = 'looker studio'
|
||||
|
||||
SERVICE_NAME_CHOICE_MAP = {
|
||||
'datastudio': GOOGLE_DATA_STUDIO_APP_NAME,
|
||||
'datastudio': GOOGLE_LOOKER_STUDIO_APP_NAME,
|
||||
'drive': DRIVE_AND_DOCS_APP_NAME,
|
||||
'googledrive': DRIVE_AND_DOCS_APP_NAME,
|
||||
'gdrive': DRIVE_AND_DOCS_APP_NAME,
|
||||
'lookerstudio': GOOGLE_DATA_STUDIO_APP_NAME,
|
||||
'lookerstudio': GOOGLE_LOOKER_STUDIO_APP_NAME,
|
||||
}
|
||||
|
||||
def _validateTransferAppName(apps, appName):
|
||||
@@ -25677,24 +25677,28 @@ def doPrintShowChromeProfiles():
|
||||
csvPF.writeCSVfile('Chrome Profiles')
|
||||
|
||||
def _getChromeProfileNameList():
|
||||
if not Cmd.PeekArgumentPresent(['select', 'filter', 'filters']):
|
||||
if not Cmd.PeekArgumentPresent(['select', 'commands', 'filter', 'filters']):
|
||||
return getString(Cmd.OB_CHROMEPROFILE_NAME_LIST).replace(',', ' ').split()
|
||||
return []
|
||||
|
||||
def _initChromeProfileNameParameters():
|
||||
cm = buildGAPIObject(API.CHROMEMANAGEMENT)
|
||||
return (cm, {'profileNameList': _getChromeProfileNameList(), 'customerId': _getCustomerId(),
|
||||
return (cm, {'profileNameList': _getChromeProfileNameList(),
|
||||
'commandNameList': [],
|
||||
'customerId': _getCustomerId(),
|
||||
'cbfilter': None, 'filterTimes': {},
|
||||
'OBY': OrderBy(CHROMEPROFILE_ORDERBY_CHOICE_MAP)})
|
||||
|
||||
def _getChromeProfileNameParameters(myarg, parameters):
|
||||
if not parameters['cbfilter'] and myarg == 'select':
|
||||
if not parameters['cbfilter'] and not parameters['commandNameList'] and myarg == 'select':
|
||||
parameters['profileNameList'].extend(getEntityList(Cmd.OB_CHROMEPROFILE_NAME_LIST))
|
||||
elif not parameters['profileNameList'] and myarg == 'orderby':
|
||||
elif not parameters['cbfilter'] and not parameters['profileNameList'] and myarg == 'commands':
|
||||
parameters['commandNameList'].extend(getEntityList(Cmd.OB_CHROMEPROFILE_COMMAND_NAME_LIST))
|
||||
elif not parameters['profileNameList'] and not parameters['commandNameList'] and myarg == 'orderby':
|
||||
parameters['OBY'].GetChoice()
|
||||
elif not parameters['profileNameList'] and myarg.startswith('filtertime'):
|
||||
elif not parameters['profileNameList'] and not parameters['commandNameList'] and myarg.startswith('filtertime'):
|
||||
parameters['filterTimes'][myarg] = getTimeOrDeltaFromNow()
|
||||
elif not parameters['profileNameList'] and myarg in {'filter', 'filters'}:
|
||||
elif not parameters['profileNameList'] and not parameters['commandNameList'] and myarg in {'filter', 'filters'}:
|
||||
parameters['cbfilter'] = getString(Cmd.OB_STRING)
|
||||
else:
|
||||
return False
|
||||
@@ -25703,9 +25707,14 @@ def _getChromeProfileNameParameters(myarg, parameters):
|
||||
def _getChromeProfileNameEntityForCommand(cm, parameters):
|
||||
if parameters['cbfilter'] is None:
|
||||
customerId = parameters['customerId']
|
||||
for i, profileName in enumerate(parameters['profileNameList']):
|
||||
if not profileName.startswith('customers'):
|
||||
parameters['profileNameList'][i] = f'customers/{customerId}/profiles/{profileName}'
|
||||
if parameters['profileNameList']:
|
||||
for i, profileName in enumerate(parameters['profileNameList']):
|
||||
if not profileName.startswith('customers'):
|
||||
parameters['profileNameList'][i] = f'customers/{customerId}/profiles/{profileName}'
|
||||
elif parameters['commandNameList']:
|
||||
for i, commandName in enumerate(parameters['commandNameList']):
|
||||
if not commandName.startswith('customers'):
|
||||
parameters['commandNameList'][i] = f'customers/{customerId}/profiles/{commandName}'
|
||||
return
|
||||
if parameters['filterTimes']:
|
||||
for filterTimeName, filterTimeValue in iter(parameters['filterTimes'].items()):
|
||||
@@ -25740,21 +25749,38 @@ def _showChromeProfileCommand(profcmd, FJQC, i=0, count=0):
|
||||
showJSON(None, profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS)
|
||||
Ind.Decrement()
|
||||
|
||||
def _printChromeProfileCommand(profcmd, csvPF, FJQC):
|
||||
row = flattenJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS)
|
||||
if not FJQC.formatJSON:
|
||||
csvPF.WriteRowTitles(row)
|
||||
elif csvPF.CheckRowTitles(row):
|
||||
csvPF.WriteRowNoFilter({'name': profcmd['name'],
|
||||
'JSON': json.dumps(cleanJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS),
|
||||
ensure_ascii=False, sort_keys=True)})
|
||||
|
||||
# gam create chromeprofilecommand <ChromeProfileNameEntity>
|
||||
# [clearcache [<Boolean>]] [clearcookies [<Boolean>]]
|
||||
# [formatjson]
|
||||
# [csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]]]
|
||||
def doCreateChromeProfileCommand():
|
||||
cm, parameters = _initChromeProfileNameParameters()
|
||||
body = {'commandType': 'clearBrowsingData', 'payload': {}}
|
||||
FJQC = FormatJSONQuoteChar()
|
||||
csvPF = None
|
||||
FJQC = FormatJSONQuoteChar(None)
|
||||
while Cmd.ArgumentsRemaining():
|
||||
myarg = getArgument()
|
||||
if myarg == 'clearcache':
|
||||
if _getChromeProfileNameParameters(myarg, parameters):
|
||||
pass
|
||||
elif myarg == 'clearcache':
|
||||
body['payload']['clearCache'] = getBoolean()
|
||||
elif myarg == 'clearcookies':
|
||||
body['payload']['clearCookies'] = getBoolean()
|
||||
elif myarg == 'csv':
|
||||
csvPF = CSVPrintFile(['name'], 'sortall')
|
||||
FJQC.SetCsvPF(csvPF)
|
||||
elif csvPF and myarg == 'todrive':
|
||||
csvPF.GetTodriveParameters()
|
||||
else:
|
||||
FJQC.GetFormatJSON(myarg)
|
||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||
_getChromeProfileNameEntityForCommand(cm, parameters)
|
||||
count = len(parameters['profileNameList'])
|
||||
i = 0
|
||||
@@ -25764,11 +25790,16 @@ def doCreateChromeProfileCommand():
|
||||
profcmd = callGAPI(cm.customers().profiles().commands(), 'create',
|
||||
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
|
||||
parent=profileName, body=body)
|
||||
_showChromeProfileCommand(profcmd, FJQC)
|
||||
if csvPF is None:
|
||||
_showChromeProfileCommand(profcmd, FJQC, i, count)
|
||||
else:
|
||||
_printChromeProfileCommand(profcmd, csvPF, FJQC)
|
||||
except (GAPI.notFound) as e:
|
||||
entityActionFailedWarning([Ent.CHROME_PROFILE_COMMAND, profileName], str(e), i, count)
|
||||
except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
||||
entityActionFailedExit([Ent.CHROME_PROFILE_COMMAND, profileName], str(e))
|
||||
if csvPF:
|
||||
csvPF.writeCSVfile('Chrome Profile Commands')
|
||||
|
||||
# gam info chromeprofilecommand <ChromeProfileCommandName>
|
||||
# [formatjson]
|
||||
@@ -25792,15 +25823,6 @@ def doInfoChromeProfileCommand():
|
||||
# gam print chromeprofilecommands <ChromeProfilNameEntity> [todrive <ToDriveAttribute>*]
|
||||
# [formatjson [quotechar <Character>]]
|
||||
def doPrintShowChromeProfileCommands():
|
||||
def _printProfileCommand(profcmd):
|
||||
row = flattenJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS)
|
||||
if not FJQC.formatJSON:
|
||||
csvPF.WriteRowTitles(row)
|
||||
elif csvPF.CheckRowTitles(row):
|
||||
csvPF.WriteRowNoFilter({'name': profcmd['name'],
|
||||
'JSON': json.dumps(cleanJSON(profcmd, timeObjects=CHROMEPROFILECOMMAND_TIME_OBJECTS),
|
||||
ensure_ascii=False, sort_keys=True)})
|
||||
|
||||
csvPF = CSVPrintFile(['name']) if Act.csvFormat() else None
|
||||
FJQC = FormatJSONQuoteChar(csvPF)
|
||||
cm, parameters = _initChromeProfileNameParameters()
|
||||
@@ -25813,32 +25835,50 @@ def doPrintShowChromeProfileCommands():
|
||||
else:
|
||||
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
||||
_getChromeProfileNameEntityForCommand(cm, parameters)
|
||||
count = len(parameters['profileNameList'])
|
||||
i = 0
|
||||
for profileName in parameters['profileNameList']:
|
||||
i +=1
|
||||
printGettingEntityItemForWhom(Ent.CHROME_PROFILE_COMMAND, profileName, i, count)
|
||||
pageMessage = getPageMessage()
|
||||
try:
|
||||
profcmds = callGAPIpages(cm.customers().profiles().commands(), 'list', 'chromeBrowserProfileCommands',
|
||||
pageMessage=pageMessage,
|
||||
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
||||
parent=profileName, pageSize=100)
|
||||
if not csvPF:
|
||||
jcount = len(profcmds)
|
||||
Ind.Increment()
|
||||
j = 0
|
||||
for profcmd in profcmds:
|
||||
j += 1
|
||||
_showChromeProfileCommand(profcmd, FJQC, j, jcount)
|
||||
Ind.Decrement()
|
||||
else:
|
||||
for profcmd in profcmds:
|
||||
_printProfileCommand(profcmd)
|
||||
except (GAPI.notFound) as e:
|
||||
entityActionFailedWarning([Ent.CHROME_PROFILE, profileName], str(e), i, count)
|
||||
except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
||||
entityActionFailedExit([Ent.CHROME_PROFILE, profileName], str(e))
|
||||
if parameters['profileNameList']:
|
||||
count = len(parameters['profileNameList'])
|
||||
i = 0
|
||||
for profileName in parameters['profileNameList']:
|
||||
i +=1
|
||||
printGettingEntityItemForWhom(Ent.CHROME_PROFILE_COMMAND, profileName, i, count)
|
||||
pageMessage = getPageMessage()
|
||||
try:
|
||||
profcmds = callGAPIpages(cm.customers().profiles().commands(), 'list', 'chromeBrowserProfileCommands',
|
||||
pageMessage=pageMessage,
|
||||
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
||||
parent=profileName, pageSize=100)
|
||||
if not csvPF:
|
||||
jcount = len(profcmds)
|
||||
Ind.Increment()
|
||||
j = 0
|
||||
for profcmd in profcmds:
|
||||
j += 1
|
||||
_showChromeProfileCommand(profcmd, FJQC, j, jcount)
|
||||
Ind.Decrement()
|
||||
else:
|
||||
for profcmd in profcmds:
|
||||
_printChromeProfileCommand(profcmd, csvPF, FJQC)
|
||||
except GAPI.notFound as e:
|
||||
entityActionFailedWarning([Ent.CHROME_PROFILE, profileName], str(e), i, count)
|
||||
except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
||||
entityActionFailedExit([Ent.CHROME_PROFILE, profileName], str(e))
|
||||
elif parameters['commandNameList']:
|
||||
count = len(parameters['commandNameList'])
|
||||
i = 0
|
||||
for profileCommandName in parameters['commandNameList']:
|
||||
i +=1
|
||||
try:
|
||||
profcmd = callGAPI(cm.customers().profiles().commands(), 'get',
|
||||
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
|
||||
name=profileCommandName)
|
||||
if not csvPF:
|
||||
_showChromeProfileCommand(profcmd, FJQC, i, count)
|
||||
else:
|
||||
_printChromeProfileCommand(profcmd, csvPF, FJQC)
|
||||
except GAPI.notFound as e:
|
||||
entityActionFailedWarning([Ent.CHROME_PROFILE_COMMAND, profileCommandName], str(e), i, count)
|
||||
except (GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
||||
entityActionFailedExit([Ent.CHROME_PROFILE, profileCommandName], str(e))
|
||||
if csvPF:
|
||||
csvPF.writeCSVfile('Chrome Profile Commands')
|
||||
|
||||
|
||||
@@ -859,6 +859,8 @@ class GamCLArgs():
|
||||
OB_CHAT_THREAD = 'ChatThread'
|
||||
OB_CHROMEPROFILE_NAME = 'ChromeProfileName'
|
||||
OB_CHROMEPROFILE_NAME_LIST = 'ChromeProfileNameList'
|
||||
OB_CHROMEPROFILE_COMMAND_NAME = 'ChromeProfileCommandName'
|
||||
OB_CHROMEPROFILE_COMMAND_NAME_LIST = 'ChromeProfileNameCommandList'
|
||||
OB_CHROME_VERSION = 'ChromeVersion'
|
||||
OB_CIDR_NETMASK = 'CIDRnetmask'
|
||||
OB_CIGROUP_ALIAS_LIST = "CIGroupAliasList"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[metadata]
|
||||
name = GAM for Google Workspace
|
||||
#version = attr: gam.var.GAM_VERSION
|
||||
version = 7.13.01
|
||||
version = 7.13.02
|
||||
description = Command line management for Google Workspaces
|
||||
long_description = file: readme.md
|
||||
long_description_content_type = text/markdown
|
||||
|
||||
@@ -284,6 +284,9 @@
|
||||
<ChatMessage> ::= spaces/<String>/messages/<String>
|
||||
<ChatSpace> ::= spaces/<String> | space <String> | space spaces/<String>
|
||||
<ChatThread> ::= spaces/<String>/threads/<String>
|
||||
<ChromeProfilePermanentID> ::= <String>
|
||||
<ChromeProfileName> ::= customers/<CustomerID>/profiles/<ChromeProfilePermanentID> | <ChromeProfilePermanentID>
|
||||
<ChromeProfileCommandName> ::= <ChomeProfileName>/commands/<String>
|
||||
<GIGroupAlias> ::= <EmailAddress>
|
||||
<GIGroupItem> ::= <EmailAddress>|<UniqueID>|groups/<String>
|
||||
<CIGroupMemberType> ::= cbcmbrowser|chromeosdevice|customer|group|other|serviceaccount|user
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
- [Delete Chrome Profiles](#delete-chrome-profiles)
|
||||
- [Display Chrome Profiles](#display-chrome-profiles)
|
||||
- [Profile Query Searchable Fields](#profile-query-searchable-fields)
|
||||
- [Collections of Chrome Profile names for commands](#collections-of-chrome-profile-names-for-commands)
|
||||
- [Create a Chrome Profile command](#create-a-chrome-profile-command)
|
||||
- [Display Chrome Profile commands](#display-chrome-profile-commands)
|
||||
|
||||
@@ -27,11 +28,18 @@ Follow instructions at: Turn on managed profile reporting
|
||||
* [Turn on Chrome Browser and Profile Reporting](https://support.google.com/chrome/a/answer/9301421)
|
||||
|
||||
## Definitions
|
||||
* [`<FileSelector> | <CSVFileSelector>`](Collections-of-Items)
|
||||
|
||||
```
|
||||
<CustomerID> ::= <String>
|
||||
<ChromeProfilePermanentID> ::= <String>
|
||||
<ChromeProfileName> ::= customers/<CustomerID>/profiles/<ChromeProfilePermanentID> | <ChromeProfilePermanentID>
|
||||
<ChromeProfileCommandName> ::= <ChomeProfileName>/commands/<String>
|
||||
<ChromeProfileNameList> ::= "<ChromeProfileName>(,<ChromeProfileName>)*"
|
||||
<ChromeProfileNameEntity> ::=
|
||||
<ChromeProfileNameList> |
|
||||
(select <FileSelector>|<CSVFileSelector>) |
|
||||
(filter <String> (filtertime<String> <Time>)* [orderby <ChromeProfileOrderByFieldName> [ascending|descending]])
|
||||
|
||||
<ChromeProfileFieldName> ::=
|
||||
affiliationstate|
|
||||
@@ -97,7 +105,7 @@ By default, Gam displays the information as an indented list of keys and values:
|
||||
|
||||
```
|
||||
gam show chromeprofiles
|
||||
[filtertime.* <Time>] [filter <String>]
|
||||
[filter <String> (filtertime<String> <Time>)*]
|
||||
[orderby <ChromeProfileOrderByFieldName> [ascending|descending]]
|
||||
<ChromeProfileFieldName>* [fields <ChromeProfileFieldNameList>]
|
||||
[formatjson]
|
||||
@@ -110,7 +118,7 @@ Select the fields to be displayed:
|
||||
* `<ChromeProfileFieldName>* [fields <ChromeProfileFieldNameList>]` - Display a selected list of fields
|
||||
|
||||
Use the `filtertime<String> <Time>` option to allow times, usually relative, to be substituted into the `filter <String>` option.
|
||||
The `filtertime<String> <Time>` value replaces the string `#fiktertime<String>#` in the `filter <String>`.
|
||||
The `filtertime<String> <Time>` value replaces the string `#filtertime<String>#` in the `filter <String>`.
|
||||
The characters following `filtertime` can be any combination of lowercase letters and numbers.
|
||||
|
||||
By default, Gam displays the information as an indented list of keys and values:
|
||||
@@ -118,7 +126,7 @@ By default, Gam displays the information as an indented list of keys and values:
|
||||
|
||||
```
|
||||
gam print chromeprofiles [todrive <ToDriveAttribute>*]
|
||||
[filtertime.* <Time>] [filter <String>]
|
||||
[filter <String> (filtertime<String> <Time>)*]
|
||||
[orderby <ChromeProfileOrderByFieldName> [ascending|descending]]
|
||||
<ChromeProfileFieldName>* [fields <ChromeProfileFieldNameList>]
|
||||
[formatjson [quotechar <Character>]]
|
||||
@@ -197,14 +205,30 @@ Print information about Chrome profiles on Windows.
|
||||
```
|
||||
gam print chromeprofiles filter "osPlatformType=WINDOWS"
|
||||
```
|
||||
## Collections of Chrome Profile names for commands
|
||||
```
|
||||
<ChromeProfileNameEntity> ::=
|
||||
<ChromeProfileNameList> |
|
||||
(select <FileSelector>|<CSVFileSelector>) |
|
||||
(filter <String> (filtertime<String> <Time>)* [orderby <ChromeProfileOrderByFieldName> [ascending|descending]])
|
||||
```
|
||||
* `<ChromeProfileNameList>` - List of Chrome profile names
|
||||
* `select <FileSelector>|<CSVFileSelector>` - A flat or CSV file containing Chrome profile names
|
||||
* `filter <String> (filtertime<String> <Time>)*` - A filter to select Chrome profiles
|
||||
|
||||
Use the `filtertime<String> <Time>` option to allow times, usually relative, to be substituted into the `filter <String>` option.
|
||||
The `filtertime<String> <Time>` value replaces the string `#filtertime<String>#` in the `filter <String>`.
|
||||
The characters following `filtertime` can be any combination of lowercase letters and numbers.
|
||||
|
||||
## Create a Chrome Profile command
|
||||
Clear a Chrome Browser profile cache and/or cookies.
|
||||
```
|
||||
gam create chromeprofilecommand <ChromeProfileName>
|
||||
gam create chromeprofilecommand <ChromeProfileNameEntity>
|
||||
[clearcache [<Boolean>]] [clearcookies [<Boolean>]]
|
||||
[formatjson]
|
||||
```
|
||||
## Display Chrome Profile commands
|
||||
Display the status of a specific Chrome Browser profile command.
|
||||
```
|
||||
gam info chromeprofilecommand <ChromeProfileCommandName>
|
||||
[formatjson]
|
||||
@@ -212,15 +236,16 @@ gam info chromeprofilecommand <ChromeProfileCommandName>
|
||||
By default, Gam displays the information as an indented list of keys and values:
|
||||
* `formatjson` - Display the fields in JSON format.
|
||||
|
||||
Display the status of selected Chrome Browser profile commands.
|
||||
```
|
||||
gam show chromeprofilecommands <ChromeProfileName>
|
||||
gam show chromeprofilecommands <ChromeProfileNameEntity>
|
||||
[formatjson]
|
||||
```
|
||||
|
||||
By default, Gam displays the information as an indented list of keys and values:
|
||||
* `formatjson` - Display the fields in JSON format.
|
||||
```
|
||||
gam print chromeprofilecommands <ChromeProfileName> [todrive <ToDriveAttribute>*]
|
||||
gam print chromeprofilecommands <ChromeProfileNameEntity> [todrive <ToDriveAttribute>*]
|
||||
[formatjson [quotechar <Character>]]
|
||||
```
|
||||
By default, Gam displays the information as columns of fields; the following option causes the output to be in JSON format:
|
||||
@@ -232,3 +257,39 @@ 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.
|
||||
|
||||
### Examples
|
||||
|
||||
For Windows PowerShell, replace `\"` with ``` `" ```.
|
||||
|
||||
Clear cache and cookies for two specific Chrome profiles:
|
||||
```
|
||||
gam create chromeprofilecommand 4c6c0a9f-de78-4285-be86-713fca8cffff,aa03151c-7c1d-41fe-b793-5753e167ffff clearcache clearcookies
|
||||
```
|
||||
|
||||
Display the status for those Chrome profiles:
|
||||
```
|
||||
gam show chromeprofilecommand 4c6c0a9f-de78-4285-be86-713fca8cffff,aa03151c-7c1d-41fe-b793-5753e167ffff
|
||||
gam print chromeprofilecommand 4c6c0a9f-de78-4285-be86-713fca8cffff,aa03151c-7c1d-41fe-b793-5753e167ffff
|
||||
```
|
||||
|
||||
Clear cache and cookies for Chrome profiles in a CSV file named `ChromeProfiles.csv` with a column `name`:
|
||||
```
|
||||
gam create chromeprofilecommand select csvfile ChromeProfiles.csv:name clearcache clearcookies
|
||||
```
|
||||
|
||||
Display the status for those Chrome profiles:
|
||||
```
|
||||
gam show chromeprofilecommand select csvfile ChromeProfiles.csv:name
|
||||
gam print chromeprofilecommand select csvfile ChromeProfiles.csv:name
|
||||
```
|
||||
|
||||
Clear cache and cookies for Chrome profiles with last activity more that 60 days ago:
|
||||
```
|
||||
gam create chromeprofilecommand filter "lastActivityTime < \"#filtertime1#\"" filtertime1 -60d clearcache clearcookies
|
||||
```
|
||||
|
||||
Display the status for those Chrome profiles:
|
||||
```
|
||||
gam show chromeprofilecommand filter "lastActivityTime < \"#filtertime1#\"" filtertime1 -60d
|
||||
gam print chromeprofilecommand filter "lastActivityTime < \"#filtertime1#\"" filtertime1 -60d
|
||||
```
|
||||
|
||||
@@ -144,6 +144,10 @@ Data fields identified in a `csvkmd` argument.
|
||||
<CalendarACLScopeList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVDataSelector>
|
||||
<CalendarEntity> ::=
|
||||
<CalendarList> | <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVDataSelector>
|
||||
<ChromeProfileNameEntity> ::=
|
||||
<ChromeProfileNameList> |
|
||||
(select <FileSelector>|<CSVFileSelector>) |
|
||||
(filter <String> (filtertime<String> <Time>)* [orderby <ChromeProfileOrderByFieldName> [ascending|descending]])
|
||||
<CIPolicyNameEntity> ::=
|
||||
<CIPolicyNameList> | <FileSelector> | <CSVFileSelector>
|
||||
<ClassificationLabelNameEntity> ::=
|
||||
@@ -206,6 +210,7 @@ Data fields identified in a `csvkmd` argument.
|
||||
all_shortcuts |
|
||||
all_3p_shortcuts |
|
||||
all_items |
|
||||
my_commentable_items |
|
||||
my_docs |
|
||||
my_files |
|
||||
my_folders |
|
||||
@@ -231,6 +236,7 @@ Data fields identified in a `csvkmd` argument.
|
||||
others_3p_shortcuts |
|
||||
others_items |
|
||||
writable_files
|
||||
|
||||
<DriveFileEntityShortcut> ::=
|
||||
alldrives |
|
||||
mydrive_any |
|
||||
@@ -246,6 +252,7 @@ Data fields identified in a `csvkmd` argument.
|
||||
sharedwithme_all |
|
||||
sharedwithme_mydrive |
|
||||
sharedwithme_notmydrive
|
||||
|
||||
<DriveFileEntity> ::=
|
||||
<DriveFileIDEntity> |
|
||||
<DriveFileNameEntity> |
|
||||
|
||||
@@ -10,6 +10,33 @@ 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.13.02
|
||||
|
||||
Fixed bug in `gam create chromeprofilecommand` where `select|filter` were not recognized.
|
||||
|
||||
Updated `gam create datatransfer <OldOwnerID> datastudio <NewOwnerID>` that generated the following
|
||||
error due to an unhandled API change.
|
||||
```
|
||||
ERROR: Invalid choice (google data studio): Expected <calendar|looker studio|drive and docs>
|
||||
```
|
||||
|
||||
### 7.13.01
|
||||
|
||||
Enhanced `gam create|print|show chromeprofilecommand` to allow specification
|
||||
of multiple Chrome browser profiles rather than just one.
|
||||
```
|
||||
<ChromeProfilePermanentID> ::= <String>
|
||||
<ChromeProfileName> ::= customers/<CustomerID>/profiles/<ChromeProfilePermanentID> | <ChromeProfilePermanentID>
|
||||
<ChromeProfileNameList> ::= "<ChromeProfileName>(,<ChromeProfileName>)*"
|
||||
<ChromeProfileNameEntity> ::=
|
||||
<ChromeProfileNameEntity> ::=
|
||||
<ChromeProfileNameList> |
|
||||
(select <FileSelector>|<CSVFileSelector>) |
|
||||
(filter <String> (filtertime<String> <Time>)* [orderby <ChromeProfileOrderByFieldName> [ascending|descending]])
|
||||
|
||||
gam create|print_show chromeprofilecommand <ChromeProfileNameEntity>
|
||||
```
|
||||
|
||||
### 7.13.00
|
||||
|
||||
Added commands that send remote commands to Chrome browser profiles and display the results;
|
||||
|
||||
@@ -13,8 +13,7 @@
|
||||
```
|
||||
<DataTransferService> ::=
|
||||
calendar|
|
||||
currents|
|
||||
datastudio|lookerstudio|"google data studio"|
|
||||
datastudio|lookerstudio|"looker studio"|
|
||||
drive|gdrive|googledrive|"drive and docs"
|
||||
<DataTransferServiceList> ::= "<DataTransferService>(,<DataTransferService>)*"
|
||||
|
||||
@@ -38,7 +37,7 @@ gam create|add datatransfer|transfer <OldOwnerID> <DataTransferServiceList> <New
|
||||
(<ParameterKey> <ParameterValue>)*
|
||||
[wait <Integer> <Integer>]
|
||||
```
|
||||
For`datastudio` and `drive`, there are options to control the privacy level of the files to be transferred.
|
||||
For`lookerstudio` and `drive`, there are options to control the privacy level of the files to be transferred.
|
||||
* `private` or `privacy_level private` - Transfer files that are not shared with anyone
|
||||
* `shared` or `privacy_level shared` - Transfer files shared with at least one other user; this is the **default**
|
||||
* `all` or `privacy_level private,shared` - Transfer all files
|
||||
|
||||
@@ -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.13.00 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.13.02 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.5 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.13.00 - https://github.com/GAM-team/GAM - pythonsource
|
||||
GAM 7.13.02 - https://github.com/GAM-team/GAM - pythonsource
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.5 64-bit final
|
||||
Windows-10-10.0.17134 AMD64
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<CalendarACLScopeList> ::= "<CalendarACLScope>(,<CalendarACLScope>)*"
|
||||
<CalendarList> ::= "<CalendarItem>(,<CalendarItem>)*"
|
||||
<ChatSpaceList> ::= "<ChatSpace>(,<ChatSpace>)*"
|
||||
<ChromeProfileNameList> ::= "<ChromeProfileName>(,<ChromeProfileName>)*"
|
||||
<CIGroupAliasList> ::= "<CIGroupAlias>(,<CIGroupAlias>)*"
|
||||
<CIGroupMemberTypeList> ::= "<CIGroupMemberType>(,<CIGroupMemberType>)*"
|
||||
<CIPolicyNameList> ::= "<CIPolicyName>(,<CIPolicyName>)*"
|
||||
|
||||
@@ -68,7 +68,7 @@ gam report <ActivityApplicationName> [todrive <ToDriveAttribute>*]
|
||||
[(user all|<UserItem>)|(orgunit|org|ou <OrgUnitPath> [showorgunit])|(select <UserTypeEntity>)]
|
||||
[([start <Time>] [end <Time>])|(range <Time> <Time>)|
|
||||
yesterday|today|thismonth|(previousmonths <Integer>)]
|
||||
[filtertime<String> <Time>] [filter|filters <String>]
|
||||
[filter <String> (filtertime<String> <Time>)*]
|
||||
[event|events <EventNameList>] [ip <String>]
|
||||
[groupidfilter <String>]
|
||||
[maxactivities <Number>] [maxevents <Number>] [maxresults <Number>]
|
||||
@@ -363,7 +363,7 @@ gam report users|user [todrive <ToDriveAttribute>*]
|
||||
[(date <Date>)|(range <Date> <Date>)|
|
||||
yesterday|today|thismonth|(previousmonths <Integer>)]
|
||||
[(nodatechange | limitdatechanges <Integer>) | (fulldatarequired all|<UserServiceNameList>)]
|
||||
[filtertime<String> <Time>] [filter|filters <String>]
|
||||
[filter <String> (filtertime<String> <Time>)*]
|
||||
[(fields|parameters <String>)|(services <UserServiceNameList>)]
|
||||
[aggregatebydate|aggregatebyuser [Boolean]]
|
||||
[maxresults <Number>]
|
||||
@@ -413,7 +413,7 @@ where you can specify a relative date without having to change the script.
|
||||
|
||||
For example, filter for last logins more that 60 days ago.
|
||||
```
|
||||
filtertime60d -60d filters "accounts:last_login_time<#filtertime60d#"
|
||||
filters "accounts:last_login_time<#filtertime60d#" filtertime60d -60d
|
||||
```
|
||||
|
||||
Select the fields/parameters to display.
|
||||
|
||||
@@ -45,6 +45,8 @@
|
||||
* [Shared Drives Search](https://developers.google.com/drive/api/guides/search-shareddrives)
|
||||
|
||||
## Definitions
|
||||
* [`<FileSelector> | <CSVFileSelector>`](Collections-of-Items)
|
||||
|
||||
```
|
||||
<ColorHex> ::= "#<Hex><Hex><Hex><Hex><Hex><Hex>"
|
||||
<ColorNameGoogle> ::=
|
||||
|
||||
@@ -290,7 +290,7 @@ Select forms with `<DriveFileEntity>`:
|
||||
* `my_forms` - Display responses for all forms owned by the user
|
||||
```
|
||||
gam <UserTypeEntity> show formresponses <DriveFileEntity>
|
||||
[filtertime.* <Time>] [filter <String>]
|
||||
[filter <String> (filtertime<String> <Time>)*]
|
||||
[countsonly|formatjson]
|
||||
```
|
||||
By default, GAM displays form response details, use the `countsonly` option to get the number of responses but no response details.
|
||||
@@ -302,11 +302,12 @@ By default, GAM displays all form responses, you can filter by response time:
|
||||
For example, to get the form responses submitted since the beginning of the year:
|
||||
* `filter timestamp >= 2022-01-01T00:00:00Z`
|
||||
|
||||
Use the `filtertime.* <Time>` option to allow times, usually relative, to be substituted into the `filter <String>` option.
|
||||
Use the `filtertime<String <Time>` option to allow times, usually relative, to be substituted into the `filter <String>` option.
|
||||
The `filtertime<String> <Time>` value replaces the string `#filtertime<String>#` in any filters..
|
||||
The characters following `filtertime` can be any combination of lowercase letters and numbers.
|
||||
|
||||
For example, to get the responses subnitted in the last four hours:
|
||||
* `filtertime4h -4h filter "timestamp >= #filtertime4h#`
|
||||
For example, to get the responses submitted in the last four hours:
|
||||
* `filter "timestamp >= #filtertime4h#" filtertime4h -4h`
|
||||
|
||||
By default, Gam displays the information as an indented list of keys and values.
|
||||
* `formatjson` - Display the form response in JSON format
|
||||
@@ -314,7 +315,7 @@ By default, Gam displays the information as an indented list of keys and values.
|
||||
```
|
||||
gam <UserTypeEntity> print formresponses <DriveFileEntity> [todrive <ToDriveAttribute>*]
|
||||
(addcsvdata <FieldName> <String>)*
|
||||
[filtertime.* <Time>] [filter <String>]
|
||||
[filter <String> (filtertime<String> <Time>)*]
|
||||
[countsonly|(formatjson [quotechar <Character>])]
|
||||
```
|
||||
By default, GAM displays form response details, use the `countsonly` option to get the number of responses but no response details.
|
||||
@@ -328,11 +329,12 @@ By default, GAM displays all form responses, you can filter by response time:
|
||||
For example, to get the form responses submitted since the beginning of the year:
|
||||
* `filter timestamp >= 2022-01-01T00:00:00Z`
|
||||
|
||||
Use the `filtertime.* <Time>` option to allow times, usually relative, to be substituted into the `filter <String>` option.
|
||||
Use the `filtertime<String> <Time>` option to allow times, usually relative, to be substituted into the `filter <String>` option.
|
||||
The `filtertime<String> <Time>` value replaces the string `#filtertime<String>#` in any filters..
|
||||
The characters following `filtertime` can be any combination of lowercase letters and numbers.
|
||||
|
||||
For example, to get the responses subnitted in the last four hours:
|
||||
* `filtertime4h -4h filter "timestamp >= #filtertime4h#`
|
||||
* `filter "timestamp >= #filtertime4h#" filtertime4h -4h`
|
||||
|
||||
By default, when writing CSV files, Gam uses a quote character of double quote `"`. The quote character is used to enclose columns that contain
|
||||
the quote character itself, the column delimiter (comma by default) and new-line characters. Any quote characters within the column are doubled.
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
k
|
||||
# Version and Help
|
||||
|
||||
Print the current version of Gam with details
|
||||
```
|
||||
gam version
|
||||
GAM 7.13.00 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.13.01 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.5 64-bit final
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
@@ -15,7 +16,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.13.00 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.13.02 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.5 64-bit final
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
@@ -27,7 +28,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.13.00 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM 7.13.02 - https://github.com/GAM-team/GAM - pyinstaller
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.5 64-bit final
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
@@ -64,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
|
||||
Path: /Users/Admin/bin/gam7
|
||||
Version Check:
|
||||
Current: 5.35.08
|
||||
Latest: 7.13.00
|
||||
Latest: 7.13.02
|
||||
echo $?
|
||||
1
|
||||
```
|
||||
@@ -72,7 +73,7 @@ echo $?
|
||||
Print the current version number without details
|
||||
```
|
||||
gam version simple
|
||||
7.13.00
|
||||
7.13.02
|
||||
```
|
||||
In Linux/MacOS you can do:
|
||||
```
|
||||
@@ -82,7 +83,7 @@ echo $VER
|
||||
Print the current version of Gam and address of this Wiki
|
||||
```
|
||||
gam help
|
||||
GAM 7.13.00 - https://github.com/GAM-team/GAM
|
||||
GAM 7.13.02 - https://github.com/GAM-team/GAM
|
||||
GAM Team <google-apps-manager@googlegroups.com>
|
||||
Python 3.13.5 64-bit final
|
||||
MacOS Sequoia 15.5 x86_64
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
oUpdate History
|
||||
Update History
|
||||
* [GAM Updates](GamUpdates)
|
||||
|
||||
Installation
|
||||
|
||||
Reference in New Issue
Block a user