Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
5b23efd83f Bump cryptography in the pip group across 1 directory
Bumps the pip group with 1 update in the / directory: [cryptography](https://github.com/pyca/cryptography).


Updates `cryptography` from 46.0.3 to 46.0.5
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.3...46.0.5)

---
updated-dependencies:
- dependency-name: cryptography
  dependency-version: 46.0.5
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-11 02:54:50 +00:00
33 changed files with 478 additions and 985 deletions

View File

@@ -86,23 +86,18 @@ jobs:
freethreaded: false freethreaded: false
goal: build goal: build
name: Build x86_64 macOS 15 name: Build x86_64 macOS 15
- os: macos-26-intel - os: macos-26
jid: 11 jid: 11
freethreaded: false freethreaded: false
goal: build goal: build
name: Build x86_64 macOS 26
- os: macos-26
jid: 12
freethreaded: false
goal: build
name: Build Arm MacOS 26 name: Build Arm MacOS 26
- os: windows-2025-vs2026 - os: windows-2025
jid: 13 jid: 12
freethreaded: false freethreaded: false
goal: build goal: build
name: Build Intel Windows name: Build Intel Windows
- os: windows-11-arm - os: windows-11-arm
jid: 14 jid: 13
freethreaded: false freethreaded: false
goal: build goal: build
name: Build Arm Windows name: Build Arm Windows
@@ -110,36 +105,36 @@ jobs:
goal: test goal: test
python: "3.10" python: "3.10"
freethreaded: false freethreaded: false
jid: 15 jid: 14
name: Test Python 3.10 name: Test Python 3.10
- os: ubuntu-24.04 - os: ubuntu-24.04
goal: test goal: test
python: "3.11" python: "3.11"
freethreaded: false freethreaded: false
jid: 16 jid: 15
name: Test Python 3.11 name: Test Python 3.11
- os: ubuntu-24.04 - os: ubuntu-24.04
goal: test goal: test
python: "3.12" python: "3.12"
freethreaded: false freethreaded: false
jid: 17 jid: 16
name: Test Python 3.12 name: Test Python 3.12
- os: ubuntu-24.04 - os: ubuntu-24.04
goal: test goal: test
python: "3.15-dev" python: "3.15-dev"
freethreaded: false freethreaded: false
jid: 18 jid: 17
name: Test Python 3.15-dev name: Test Python 3.15-dev
- os: ubuntu-24.04 - os: ubuntu-24.04
goal: test goal: test
python: "3.14" python: "3.14"
freethreaded: true freethreaded: true
jid: 19 jid: 18
name: Test Python 3.14 freethread name: Test Python 3.14 freethread
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
with: with:
persist-credentials: false persist-credentials: false
fetch-depth: 0 fetch-depth: 0
@@ -153,12 +148,12 @@ jobs:
- name: Cache multiple paths - name: Cache multiple paths
if: matrix.goal == 'build' if: matrix.goal == 'build'
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 uses: actions/cache@638ed79f9dc94c1de1baef91bcab5edaa19451f4 # v4.2.4
id: cache-python-ssl id: cache-python-ssl
with: with:
path: | path: |
cache.tar.xz cache.tar.xz
key: gam-${{ matrix.jid }}-20260227 key: gam-${{ matrix.jid }}-20260129
- name: Untar Cache archive - name: Untar Cache archive
if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true' if: matrix.goal == 'build' && steps.cache-python-ssl.outputs.cache-hit == 'true'
@@ -168,7 +163,7 @@ jobs:
- name: Use pre-compiled Python for testing - name: Use pre-compiled Python for testing
if: matrix.python != '' if: matrix.python != ''
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with: with:
python-version: ${{ matrix.python }} python-version: ${{ matrix.python }}
allow-prereleases: true allow-prereleases: true
@@ -252,7 +247,7 @@ jobs:
- name: MacOS import developer certificates for signing - name: MacOS import developer certificates for signing
if: runner.os == 'macOS' if: runner.os == 'macOS'
uses: apple-actions/import-codesign-certs@b610f78488812c1e56b20e6df63ec42d833f2d14 # v6.0.0 uses: apple-actions/import-codesign-certs@11e1bb2d3771ad8ffa8459dfe527bc26b2dd4b62 # v5.0.3
with: with:
p12-file-base64: ${{ secrets.CERTIFICATES_P12 }} p12-file-base64: ${{ secrets.CERTIFICATES_P12 }}
p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }} p12-password: ${{ secrets.CERTIFICATES_P12_PASSWORD }}
@@ -476,7 +471,7 @@ jobs:
- name: Run Python - name: Run Python
run: | run: |
"${PYTHON}" -VV "${PYTHON}" -V
"${PYTHON}" -c "import ssl; print(f'Using {ssl.OPENSSL_VERSION}')" "${PYTHON}" -c "import ssl; print(f'Using {ssl.OPENSSL_VERSION}')"
- name: Create and use Python venv - name: Create and use Python venv
@@ -512,8 +507,6 @@ jobs:
"$PYTHON" -m pip list "$PYTHON" -m pip list
- name: Install pip requirements - name: Install pip requirements
env:
GH_TOKEN: ${{ github.token }}
run: | run: |
echo "before anything..." echo "before anything..."
"$PYTHON" -m pip list "$PYTHON" -m pip list
@@ -524,12 +517,6 @@ jobs:
echo "--pip debug verbose--" echo "--pip debug verbose--"
"$PYTHON" -m pip debug --verbose "$PYTHON" -m pip debug --verbose
echo "--------" echo "--------"
if ([ "$RUNNER_OS" == "Windows" ] && [ "$RUNNER_ARCH" == "ARM64" ]); then
# custom cryptography wheel for win arm64 since the project doesn't provide one:
# https://github.com/pyca/cryptography/issues/14293
gh release download --repo "jay0lee/cryptography-wheels" --pattern "*win_arm64.whl" --clobber
"$PYTHON" -m pip install cryptography-*.whl
fi
"$PYTHON" -m pip install -vvv --upgrade ..[yubikey] "$PYTHON" -m pip install -vvv --upgrade ..[yubikey]
echo "after everything..." echo "after everything..."
"$PYTHON" -m pip list "$PYTHON" -m pip list
@@ -638,19 +625,13 @@ jobs:
- name: MacOS send GAM binary for Apple notarization - name: MacOS send GAM binary for Apple notarization
if: runner.os == 'macOS' if: runner.os == 'macOS'
env: env:
APPLE_KEY: ${{ secrets.APPLE_KEY }} ASP_NOTARIZE: ${{ secrets.ASP_NOTARIZE }}
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
run: | run: |
# Apple wants some kind of "package" submitted so just add gam to a .zip # Apple wants some kind of "package" submitted so just add gam to a .zip
# name it something we can track and link in Apple's notarize process # name it something we can track and link in Apple's notarize process
zipfilename="./gam-${RUNNER_ARCH}-${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}.zip" zipfilename="./gam-${RUNNER_ARCH}-${GITHUB_RUN_ID}-${GITHUB_RUN_NUMBER}.zip"
zip -r "$zipfilename" "$gampath" zip -r "$zipfilename" "$gampath"
export KEY_FILE="$(mktemp).p8" xcrun notarytool submit --apple-id "jay0lee@gmail.com" --password "$ASP_NOTARIZE" --team-id GZ85H2DRLM "$zipfilename"
trap 'rm -f "$KEY_FILE"' EXIT
echo "$APPLE_KEY" > "$KEY_FILE"
xcrun notarytool submit "$zipfilename" --key "$KEY_FILE" --key-id "$APPLE_KEY_ID" --issuer "$APPLE_ISSUER_ID"
rm -v "$KEY_FILE"
rm -v "$zipfilename" rm -v "$zipfilename"
- name: Basic Tests all jobs - name: Basic Tests all jobs
@@ -688,9 +669,10 @@ jobs:
if: runner.os == 'Windows' if: runner.os == 'Windows'
shell: pwsh shell: pwsh
run: | run: |
#$url = "https://files.certum.eu/software/SimplySignDesktop/Windows/9.3.4.72/SimplySignDesktop-9.3.4.72-64-bit-en.msi" #$url = "https://files.certum.eu/software/SimplySignDesktop/Windows/9.3.2.67/SimplySignDesktop-9.3.2.67-64-bit-en.msi"
$url = "https://www.files.certum.eu/software/SimplySignDesktop/Windows/9.4.0.84/SimplySignDesktop-9.4.0.84-64-bit-en.msi" #$file = "SimplySignDesktop-9.3.2.67-64-bit-en.msi"
$file = "SimplySignDesktop.msi" $url = "https://files.certum.eu/software/SimplySignDesktop/Windows/9.3.4.72/SimplySignDesktop-9.3.4.72-64-bit-en.msi"
$file = "SimplySignDesktop-9.3.4.72-64-bit-en.msi"
Invoke-WebRequest $url -OutFile $file Invoke-WebRequest $url -OutFile $file
$log = "install.log" $log = "install.log"
$procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru $procMain = Start-Process "msiexec" "/i `"$file`" /qn /l*! `"$log`"" -NoNewWindow -PassThru
@@ -737,7 +719,7 @@ jobs:
$gam create signjwtserviceaccount $gam create signjwtserviceaccount
- name: Attest gam executable was generated from this Action - name: Attest gam executable was generated from this Action
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 uses: actions/attest-build-provenance@0b6e9809265278d02c58acf52849a95818a5a306 # v3.0.0
if: matrix.goal == 'build' if: matrix.goal == 'build'
with: with:
subject-path: ${{ env.gam }} subject-path: ${{ env.gam }}
@@ -801,7 +783,7 @@ jobs:
& 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe' verify /pa /v "$env:MSI_FILENAME" & 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\signtool.exe' verify /pa /v "$env:MSI_FILENAME"
- name: Attest that gam package files were generated from this Action - name: Attest that gam package files were generated from this Action
uses: actions/attest@59d89421af93a897026c735860bf21b6eb4f7b26 # v4.1.0 uses: actions/attest-build-provenance@0b6e9809265278d02c58acf52849a95818a5a306 # v3.0.0
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.goal == 'build' if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.goal == 'build'
with: with:
subject-path: | subject-path: |
@@ -809,32 +791,17 @@ jobs:
gam*.zip gam*.zip
gam*.msi gam*.msi
- name: Archive tar.xz artifacts - name: Archive production artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0 uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
if: runner.os != 'Windows' #if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') && matrix.goal != 'test'
if: always()
with: with:
archive: false name: gam-binaries-${{ env.GAMOS }}-${{ env.arch }}-${{ matrix.jid }}
if-no-files-found: ignore
path: | path: |
gam*.tar.xz gam*.tar.xz
- name: Archive zip artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0
if: runner.os == 'Windows'
with:
archive: false
if-no-files-found: ignore
path: |
gam*.zip gam*.zip
- name: Archive msi artifacts
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # 7.0.0
if: runner.os == 'Windows'
with:
archive: false
if-no-files-found: ignore
path: |
gam*.msi gam*.msi
*.png
- name: Basic Tests build jobs only - name: Basic Tests build jobs only
if: matrix.goal != 'test' && steps.cache-python-ssl.outputs.cache-hit != 'true' if: matrix.goal != 'test' && steps.cache-python-ssl.outputs.cache-hit != 'true'
@@ -1068,10 +1035,24 @@ jobs:
echo '.git*' > ./excludes.txt echo '.git*' > ./excludes.txt
tar cJvvf cache.tar.xz --exclude-from=excludes.txt $tar_folders tar cJvvf cache.tar.xz --exclude-from=excludes.txt $tar_folders
merge:
if: (github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-24.04
needs: build
permissions:
contents: write
packages: write
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: gam-binaries
pattern: gam-binaries-*
publish: publish:
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-24.04 runs-on: ubuntu-24.04
needs: build needs: merge
permissions: permissions:
contents: write contents: write
packages: write packages: write
@@ -1079,16 +1060,13 @@ jobs:
steps: steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
with: with:
persist-credentials: false persist-credentials: false
fetch-depth: 0 fetch-depth: 0
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # 5.0.0
with:
path: gam-binaries/
merge-multiple: true
- name: VirusTotal Scan - name: VirusTotal Scan
uses: crazy-max/ghaction-virustotal@d34968c958ae283fe976efed637081b9f9dcf74f # 4.2.0 uses: crazy-max/ghaction-virustotal@d34968c958ae283fe976efed637081b9f9dcf74f # 4.2.0
@@ -1105,7 +1083,7 @@ jobs:
echo "dateversion=${dateversion}" >> $GITHUB_OUTPUT echo "dateversion=${dateversion}" >> $GITHUB_OUTPUT
- name: Publish draft release - name: Publish draft release
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0 uses: softprops/action-gh-release@6cbd405e2c4e67a21c47fa9e383d020e4e28b836 # v2.3.3
with: with:
draft: true draft: true
prerelease: false prerelease: false

View File

@@ -11,8 +11,8 @@ authors = [
#significant compile dependencies. #significant compile dependencies.
dependencies = [ dependencies = [
"arrow>=1.3.0", "arrow>=1.3.0",
"chardet==5.2.0", "chardet>=5.2.0",
"cryptography>=46.0.5", "cryptography==46.0.5",
"distro; sys_platform=='linux'", "distro; sys_platform=='linux'",
"filelock>=3.18.0", "filelock>=3.18.0",
"google-api-python-client>=2.167.0", "google-api-python-client>=2.167.0",

View File

@@ -4662,7 +4662,6 @@ gam report <ActivityApplicationName> [todrive <ToDriveAttribute>*]
[event|events <EventNameList>] [ip <String>] [event|events <EventNameList>] [ip <String>]
[gmaileventtypes <NumberRangeList>] [gmaileventtypes <NumberRangeList>]
[groupidfilter <String>] [resourcedetailsfilter <String>] [groupidfilter <String>] [resourcedetailsfilter <String>]
[notimesort]
[maxactivities <Number>] [maxevents <Number>] [maxresults <Number>] [maxactivities <Number>] [maxevents <Number>] [maxresults <Number>]
[countsonly [bydate|summary] [eventrowfilter]] [countsonly [bydate|summary] [eventrowfilter]]
(addcsvdata <FieldName> <String>)* [shownoactivities] (addcsvdata <FieldName> <String>)* [shownoactivities]
@@ -5693,7 +5692,6 @@ gam download storagefile <StorageBucketObjectName>
fullname| fullname|
gender| gender|
givenname|firstname| givenname|firstname|
guestaccountinfo|
id| id|
ims|im| ims|im|
includeinglobaladdresslist|gal| includeinglobaladdresslist|gal|
@@ -5701,7 +5699,6 @@ gam download storagefile <StorageBucketObjectName>
isdelegatedadmin|admin|isadmin| isdelegatedadmin|admin|isadmin|
isenforcedin2sv|is2svenforced| isenforcedin2sv|is2svenforced|
isenrolledin2sv|is2svenrolled| isenrolledin2sv|is2svenrolled|
isguestuser|
ismailboxsetup| ismailboxsetup|
keyword|keywords| keyword|keywords|
language|languages| language|languages|
@@ -6909,7 +6906,6 @@ gam <UserTypeEntity> copy drivefile <DriveFileEntity>
[copyfilepermissions [<Boolean>]] [copyfilepermissions [<Boolean>]]
[copyfileinheritedpermissions [<Boolean>] [copyfileinheritedpermissions [<Boolean>]
[copyfilenoninheritedpermissions [<Boolean>] [copyfilenoninheritedpermissions [<Boolean>]
[copyfolderpermissions [<Boolean>]]
[copymergewithparentfolderpermissions [<Boolean>]] [copymergewithparentfolderpermissions [<Boolean>]]
[copymergedtopfolderpermissions [<Boolean>]] [copymergedtopfolderpermissions [<Boolean>]]
[copytopfolderpermissions [<Boolean>]] [copytopfolderpermissions [<Boolean>]]
@@ -6939,7 +6935,6 @@ gam <UserTypeEntity> move drivefile <DriveFileEntity> [newfilename <DriveFileNam
[createshortcutsfornonmovablefiles [<Boolean>]] [createshortcutsfornonmovablefiles [<Boolean>]]
[duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip] [duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip]
[duplicatefolders merge|duplicatename|uniquename|skip] [duplicatefolders merge|duplicatename|uniquename|skip]
[copyfolderpermissions [<Boolean>]]
[copymergewithparentfolderpermissions [<Boolean>]] [copymergewithparentfolderpermissions [<Boolean>]]
[copymergedtopfolderpermissions [<Boolean>]] [copymergedtopfolderpermissions [<Boolean>]]
[copytopfolderpermissions [<Boolean>]] [copytopfolderpermissions [<Boolean>]]

View File

@@ -1,137 +1,3 @@
7.34.10
Fixed bug where `formatjson quotechar <Character>` on the command line did not override `redirect csv <FileName> multiprocess quotechar <Character>`.
7.34.09
Updated `gam <UserTypeEntity> update photo` to delete the user's existing photo
before performing the update as the API update will succeed but not replace a user's existing self-set photo.
7.34.08
Rebuild to avoid the following error:
```
requests/__init__.py:113: RequestsDependencyWarning: urllib3 (2.6.3) or chardet (6.0.0.post1)/charset_normalizer (3.4.4) doesn't match a supported version!
```
7.34.07
Added the following command to create a guest user.
* See: https://support.google.com/a/answer/16558545
```
gam create guestuser <EmailAddress>
```
Added the following items to `<UserFieldName>`:
* `guestaccountinfo` - Additional guest-related metadata fields
* `isguestuser` - Indicates if the inserted user is a guest
7.34.06
Added option `copyfolderpermissions [<Boolean>]` to `gam <UserTypeEntity> copy|move drivefile`.
When `copyfolderpermissions false` is specified, no folder permissions are copied; this simplifies
disabling all folder permission copying.
When not specified or `copyfolderpermissions [true]` is specified, folder permissions are copied based on the following options:
```
copymergewithparentfolderpermissions [<Boolean>]
copymergedtopfolderpermissions [<Boolean>]
copytopfolderpermissions [<Boolean>]
copytopfolderiheritedpermissions [<Boolean>]
copytopfoldernoniheritedpermissions never|always|syncallfolders|syncupdatedfolders
copymergedsubfolderpermissions [<Boolean>]
copysubfolderpermissions [<Boolean>]
copysubfolderinheritedpermissions [<Boolean>]
copysubfoldernoniheritedpermissions never|always|syncallfolders|syncupdatedfolders
```
7.34.05
Updated `gam report <ActivityApplictionName>` to perform a reverse chronological sort
on all rows across multiple users and/or event names; this is consistent with the behavior
in the Admin console. Use option `notimesort` to suppress this sort.
7.34.04
Updated `gam <UserTypeEntity> create drivefileacl <DriveFileEntity> user <UserItem> role owner` to better
handle the case where the current owner of a file is suspended. Previously, the command was displayed as an error
even though the ownership was changed.
```
gam user currentowner@domain.com add drivefileacl <DriveFileID> user newowner@domain.com role owner
User: currentowner@domain.com, Add 1 Drive File/Folder ACL
User: currentowner@domain.com, Drive File/Folder ID: <DriveFileID>, Permission ID: newowner@domain.com, Add Failed: Sorry, the items were successfully shared but emails could not be sent to newowner@domain.com.
```
Now the command is displayed as a success with a note indicating that the ownership change email was not sent.
```
gam user currentowner@domain.com add drivefileacl <DriveFileID> user newowner@domain.com role owner
User: currentowner@domain.com, Add 1 Drive File/Folder ACL
User: currentowner@domain.com, Drive File/Folder ID: <DriveFileID>, Permission ID: newowner@domain.com, Added: Sorry, the items were successfully shared but emails could not be sent to newowner@domain.com.
New Owner
id: 10834698115409747890
type: user
emailAddress: newowner@domain.com
domain: domain.com
role: owner
permissionDetails:
role: writer
type: file
inherited: True
inheritedFrom: Unknown
role: owner
type: file
inherited: False
deleted: False
pendingOwner: False
```
7.34.03
Updated to Python 3.14.3
Updated Cryptography to 46.0.5
Updated `gam course <CourseID> create student|teacher <EmailAddress>` error message when
`<EmailAddress>` is not in a trusted domain to remove suggestion about creating an invitation.
7.34.02
Updated GAM to prevent errors like the following:
```
ERROR: Unable to find the server at oauth2.googleapis.com
ERROR: Unable to find the server at gmail.googleapis.com
```
If you experience any unexpected errors, post a message to:
* The GAM Discussion Forum (google-apps-manager@googlegroups.com)
* The GAM Public Chat Room (https://chat.google.com/app/chat/AAAA4BULhWo)
7.34.01
Updated `gam create|update adminrole` to handle the following errors:
```
ERROR: 400: invalid - Invalid Role privileges
ERROR: 400: required - Required parameter: [resource.privileges[n].service_id]
```
7.34.00
Added variable `csv_output_header_required` to `gam.cfg` that is a comma separated list of `<Strings>`
that are required to be in the list of column headers in the CSV file written by a gam print command.
This will typically be used to specify headers that are required in subsequent commands that process
the CSV file even if the API didn't return any data for those columns.
Updated the following commands to not require the `Directory API - Domains` scope
unless the `internal` or `external` options are used to request the member category.
```
gam info|print groups
gam print|show group-members
gam info|print cigroups
gam print|show cigroup-members
gam <UserTypeEntity> print|show filesharecounts
```
7.33.03 7.33.03
Fixed bug in `gam [<UserTypeEntity>] sendemail ... from <EmailAddress> replyto <EmailAddress>` Fixed bug in `gam [<UserTypeEntity>] sendemail ... from <EmailAddress> replyto <EmailAddress>`

View File

@@ -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.34.10' __version__ = '7.33.03'
__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
@@ -4177,7 +4177,6 @@ def SetGlobalVariables():
GC.Values[GC.CSV_OUTPUT_HEADER_FILTER] = _getCfgHeaderFilter(outputFilterSectionName, GC.CSV_OUTPUT_HEADER_FILTER) GC.Values[GC.CSV_OUTPUT_HEADER_FILTER] = _getCfgHeaderFilter(outputFilterSectionName, GC.CSV_OUTPUT_HEADER_FILTER)
GC.Values[GC.CSV_OUTPUT_HEADER_DROP_FILTER] = _getCfgHeaderFilter(outputFilterSectionName, GC.CSV_OUTPUT_HEADER_DROP_FILTER) GC.Values[GC.CSV_OUTPUT_HEADER_DROP_FILTER] = _getCfgHeaderFilter(outputFilterSectionName, GC.CSV_OUTPUT_HEADER_DROP_FILTER)
GC.Values[GC.CSV_OUTPUT_HEADER_ORDER] = _getCfgStringList(outputFilterSectionName, GC.CSV_OUTPUT_HEADER_ORDER) GC.Values[GC.CSV_OUTPUT_HEADER_ORDER] = _getCfgStringList(outputFilterSectionName, GC.CSV_OUTPUT_HEADER_ORDER)
GC.Values[GC.CSV_OUTPUT_HEADER_REQUIRED] = _getCfgStringList(outputFilterSectionName, GC.CSV_OUTPUT_HEADER_REQUIRED)
GC.Values[GC.CSV_OUTPUT_ROW_FILTER] = _getCfgRowFilter(outputFilterSectionName, GC.CSV_OUTPUT_ROW_FILTER) GC.Values[GC.CSV_OUTPUT_ROW_FILTER] = _getCfgRowFilter(outputFilterSectionName, GC.CSV_OUTPUT_ROW_FILTER)
GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE] = _getCfgChoice(outputFilterSectionName, GC.CSV_OUTPUT_ROW_FILTER_MODE) GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE] = _getCfgChoice(outputFilterSectionName, GC.CSV_OUTPUT_ROW_FILTER_MODE)
GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER] = _getCfgRowFilter(outputFilterSectionName, GC.CSV_OUTPUT_ROW_DROP_FILTER) GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER] = _getCfgRowFilter(outputFilterSectionName, GC.CSV_OUTPUT_ROW_DROP_FILTER)
@@ -4312,8 +4311,6 @@ def SetGlobalVariables():
GC.Values[GC.CSV_OUTPUT_HEADER_FORCE] = GM.Globals[GM.CSV_OUTPUT_HEADER_FORCE][:] GC.Values[GC.CSV_OUTPUT_HEADER_FORCE] = GM.Globals[GM.CSV_OUTPUT_HEADER_FORCE][:]
if not GC.Values[GC.CSV_OUTPUT_HEADER_ORDER]: if not GC.Values[GC.CSV_OUTPUT_HEADER_ORDER]:
GC.Values[GC.CSV_OUTPUT_HEADER_ORDER] = GM.Globals[GM.CSV_OUTPUT_HEADER_ORDER][:] GC.Values[GC.CSV_OUTPUT_HEADER_ORDER] = GM.Globals[GM.CSV_OUTPUT_HEADER_ORDER][:]
if not GC.Values[GC.CSV_OUTPUT_HEADER_REQUIRED]:
GC.Values[GC.CSV_OUTPUT_HEADER_REQUIRED] = GM.Globals[GM.CSV_OUTPUT_HEADER_REQUIRED][:]
if not GC.Values[GC.CSV_OUTPUT_ROW_FILTER]: if not GC.Values[GC.CSV_OUTPUT_ROW_FILTER]:
GC.Values[GC.CSV_OUTPUT_ROW_FILTER] = GM.Globals[GM.CSV_OUTPUT_ROW_FILTER][:] GC.Values[GC.CSV_OUTPUT_ROW_FILTER] = GM.Globals[GM.CSV_OUTPUT_ROW_FILTER][:]
GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE] = GM.Globals[GM.CSV_OUTPUT_ROW_FILTER_MODE] GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE] = GM.Globals[GM.CSV_OUTPUT_ROW_FILTER_MODE]
@@ -5713,9 +5710,7 @@ def chooseSaAPI(api1, api2):
def buildGAPIServiceObject(api, user, i=0, count=0, displayError=True): def buildGAPIServiceObject(api, user, i=0, count=0, displayError=True):
userEmail = getSaUser(user) userEmail = getSaUser(user)
if GM.Globals[GM.HTTP_OBJECT] is None: httpObj = getHttpObj(cache=GM.Globals[GM.CACHE_DIR])
GM.Globals[GM.HTTP_OBJECT] = getHttpObj(cache=GM.Globals[GM.CACHE_DIR])
httpObj = GM.Globals[GM.HTTP_OBJECT]
service = getService(api, httpObj) service = getService(api, httpObj)
credentials = getSvcAcctCredentials(api, userEmail) credentials = getSvcAcctCredentials(api, userEmail)
request = transportCreateRequest(httpObj) request = transportCreateRequest(httpObj)
@@ -6089,7 +6084,7 @@ def _checkMemberCategory(member, memberDisplayOptions):
if memberDisplayOptions['showCategory']: if memberDisplayOptions['showCategory']:
member['category'] = category member['category'] = category
if memberDisplayOptions['checkCategory']: if memberDisplayOptions['checkCategory']:
return bool(memberDisplayOptions[category]) return True if memberDisplayOptions[category] else False
return True return True
def _checkCIMemberCategory(member, memberDisplayOptions): def _checkCIMemberCategory(member, memberDisplayOptions):
@@ -6102,7 +6097,7 @@ def _checkCIMemberCategory(member, memberDisplayOptions):
if memberDisplayOptions['showCategory']: if memberDisplayOptions['showCategory']:
member['category'] = category member['category'] = category
if memberDisplayOptions['checkCategory']: if memberDisplayOptions['checkCategory']:
return bool(memberDisplayOptions[category]) return True if memberDisplayOptions[category] else False
return True return True
def getCIGroupMemberRoleFixType(member): def getCIGroupMemberRoleFixType(member):
@@ -7927,7 +7922,6 @@ class CSVPrintFile():
self.JSONtitlesList = [] self.JSONtitlesList = []
self.sortHeaders = [] self.sortHeaders = []
self.SetHeaderForce(GC.Values[GC.CSV_OUTPUT_HEADER_FORCE]) self.SetHeaderForce(GC.Values[GC.CSV_OUTPUT_HEADER_FORCE])
self.SetHeaderRequired(GC.Values[GC.CSV_OUTPUT_HEADER_REQUIRED])
if not self.headerForce and titles is not None: if not self.headerForce and titles is not None:
self.SetTitles(titles) self.SetTitles(titles)
self.SetJSONTitles(titles) self.SetJSONTitles(titles)
@@ -8644,9 +8638,6 @@ class CSVPrintFile():
self.SetTitles(headerForce) self.SetTitles(headerForce)
self.SetJSONTitles(headerForce) self.SetJSONTitles(headerForce)
def SetHeaderRequired(self, headerRequired):
self.headerRequired = headerRequired
def SetHeaderOrder(self, headerOrder): def SetHeaderOrder(self, headerOrder):
self.headerOrder = headerOrder self.headerOrder = headerOrder
@@ -9090,8 +9081,6 @@ class CSVPrintFile():
extrasaction = 'raise' extrasaction = 'raise'
if not self.formatJSON: if not self.formatJSON:
if not self.headerForce: if not self.headerForce:
if self.headerRequired:
self.AddTitles(self.headerRequired)
self.SortTitles() self.SortTitles()
self.SortIndexedTitles(self.titlesList) self.SortIndexedTitles(self.titlesList)
if self.fixPaths: if self.fixPaths:
@@ -9109,17 +9098,6 @@ class CSVPrintFile():
titlesList = self.titlesList titlesList = self.titlesList
else: else:
if not self.headerForce: if not self.headerForce:
if self.headerRequired:
for i, v in enumerate(self.JSONtitlesList):
if v.startswith('JSON'):
j = i
for title in self.headerRequired:
self.JSONtitlesList.insert(j, title)
self.JSONtitlesSet.add(title)
j += 1
break
else:
self.AddJSONTitles(self.headerRequired)
if self.fixPaths: if self.fixPaths:
self.FixPathsTitles(self.JSONtitlesList) self.FixPathsTitles(self.JSONtitlesList)
if not self.rows and self.nodataFields is not None: if not self.rows and self.nodataFields is not None:
@@ -9725,6 +9703,8 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
GC.Values[GC.TIMEZONE] = tzinfo GC.Values[GC.TIMEZONE] = tzinfo
GC.Values[GC.OUTPUT_TIMEFORMAT] = output_timeformat GC.Values[GC.OUTPUT_TIMEFORMAT] = output_timeformat
clearRowFilters = False clearRowFilters = False
# if sys.platform.startswith('win'):
# signal.signal(signal.SIGINT, signal.SIG_IGN)
if multiprocessing.get_start_method() != 'fork': if multiprocessing.get_start_method() != 'fork':
signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGINT, signal.SIG_IGN)
Cmd = glclargs.GamCLArgs() Cmd = glclargs.GamCLArgs()
@@ -9774,7 +9754,7 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
GC.Values = dataItem GC.Values = dataItem
csvPF.SetColumnDelimiter(GC.Values[GC.CSV_OUTPUT_COLUMN_DELIMITER]) csvPF.SetColumnDelimiter(GC.Values[GC.CSV_OUTPUT_COLUMN_DELIMITER])
csvPF.SetNoEscapeChar(GC.Values[GC.CSV_OUTPUT_NO_ESCAPE_CHAR]) csvPF.SetNoEscapeChar(GC.Values[GC.CSV_OUTPUT_NO_ESCAPE_CHAR])
# csvPF.SetQuoteChar(GC.Values[GC.CSV_OUTPUT_QUOTE_CHAR]) csvPF.SetQuoteChar(GC.Values[GC.CSV_OUTPUT_QUOTE_CHAR])
csvPF.SetSortHeaders(GC.Values[GC.CSV_OUTPUT_SORT_HEADERS]) csvPF.SetSortHeaders(GC.Values[GC.CSV_OUTPUT_SORT_HEADERS])
csvPF.SetTimestampColumn(GC.Values[GC.CSV_OUTPUT_TIMESTAMP_COLUMN]) csvPF.SetTimestampColumn(GC.Values[GC.CSV_OUTPUT_TIMESTAMP_COLUMN])
csvPF.SetHeaderFilter(GC.Values[GC.CSV_OUTPUT_HEADER_FILTER]) csvPF.SetHeaderFilter(GC.Values[GC.CSV_OUTPUT_HEADER_FILTER])
@@ -9841,6 +9821,8 @@ def StdQueueHandler(mpQueue, stdtype, gmGlobals, gcValues):
except IOError as e: except IOError as e:
systemErrorExit(FILE_ERROR_RC, fdErrorMessage(fd, GM.Globals[stdtype][GM.REDIRECT_NAME], e)) systemErrorExit(FILE_ERROR_RC, fdErrorMessage(fd, GM.Globals[stdtype][GM.REDIRECT_NAME], e))
# if sys.platform.startswith('win'):
# signal.signal(signal.SIGINT, signal.SIG_IGN)
if multiprocessing.get_start_method() != 'fork': if multiprocessing.get_start_method() != 'fork':
signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGINT, signal.SIG_IGN)
GM.Globals = gmGlobals.copy() GM.Globals = gmGlobals.copy()
@@ -9925,7 +9907,7 @@ def ProcessGAMCommandMulti(pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout,
csvColumnDelimiter, csvNoEscapeChar, csvQuoteChar, csvColumnDelimiter, csvNoEscapeChar, csvQuoteChar,
csvSortHeaders, csvTimestampColumn, csvSortHeaders, csvTimestampColumn,
csvHeaderFilter, csvHeaderDropFilter, csvHeaderFilter, csvHeaderDropFilter,
csvHeaderForce, csvHeaderOrder, csvHeaderRequired, csvHeaderForce, csvHeaderOrder,
csvRowFilter, csvRowFilterMode, csvRowDropFilter, csvRowDropFilterMode, csvRowFilter, csvRowFilterMode, csvRowDropFilter, csvRowDropFilterMode,
csvRowLimit, csvRowLimit,
showGettings, showGettingsGotNL, showGettings, showGettingsGotNL,
@@ -9934,6 +9916,7 @@ def ProcessGAMCommandMulti(pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout,
with mplock: with mplock:
initializeLogging() initializeLogging()
# if sys.platform.startswith('win'):
if multiprocessing.get_start_method() != 'fork': if multiprocessing.get_start_method() != 'fork':
signal.signal(signal.SIGINT, signal.SIG_IGN) signal.signal(signal.SIGINT, signal.SIG_IGN)
GM.Globals[GM.API_CALLS_RETRY_DATA] = {} GM.Globals[GM.API_CALLS_RETRY_DATA] = {}
@@ -9949,7 +9932,6 @@ def ProcessGAMCommandMulti(pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout,
GM.Globals[GM.CSV_OUTPUT_HEADER_FILTER] = csvHeaderFilter[:] GM.Globals[GM.CSV_OUTPUT_HEADER_FILTER] = csvHeaderFilter[:]
GM.Globals[GM.CSV_OUTPUT_HEADER_FORCE] = csvHeaderForce[:] GM.Globals[GM.CSV_OUTPUT_HEADER_FORCE] = csvHeaderForce[:]
GM.Globals[GM.CSV_OUTPUT_HEADER_ORDER] = csvHeaderOrder[:] GM.Globals[GM.CSV_OUTPUT_HEADER_ORDER] = csvHeaderOrder[:]
GM.Globals[GM.CSV_OUTPUT_HEADER_REQUIRED] = csvHeaderRequired[:]
GM.Globals[GM.CSV_OUTPUT_QUOTE_CHAR] = csvQuoteChar GM.Globals[GM.CSV_OUTPUT_QUOTE_CHAR] = csvQuoteChar
GM.Globals[GM.CSV_OUTPUT_ROW_DROP_FILTER] = csvRowDropFilter[:] GM.Globals[GM.CSV_OUTPUT_ROW_DROP_FILTER] = csvRowDropFilter[:]
GM.Globals[GM.CSV_OUTPUT_ROW_DROP_FILTER_MODE] = csvRowDropFilterMode GM.Globals[GM.CSV_OUTPUT_ROW_DROP_FILTER_MODE] = csvRowDropFilterMode
@@ -10174,7 +10156,6 @@ def MultiprocessGAMCommands(items, showCmds):
GC.Values[GC.CSV_OUTPUT_HEADER_DROP_FILTER], GC.Values[GC.CSV_OUTPUT_HEADER_DROP_FILTER],
GC.Values[GC.CSV_OUTPUT_HEADER_FORCE], GC.Values[GC.CSV_OUTPUT_HEADER_FORCE],
GC.Values[GC.CSV_OUTPUT_HEADER_ORDER], GC.Values[GC.CSV_OUTPUT_HEADER_ORDER],
GC.Values[GC.CSV_OUTPUT_HEADER_REQUIRED],
GC.Values[GC.CSV_OUTPUT_ROW_FILTER], GC.Values[GC.CSV_OUTPUT_ROW_FILTER],
GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE],
GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER], GC.Values[GC.CSV_OUTPUT_ROW_DROP_FILTER],
@@ -13824,9 +13805,7 @@ REPORT_ACTIVITIES_TIME_OBJECTS = {'time'}
# yesterday|today|thismonth|(previousmonths <Integer>)] # yesterday|today|thismonth|(previousmonths <Integer>)]
# [filter <String> (filtertime<String> <Time>)*] # [filter <String> (filtertime<String> <Time>)*]
# [event|events <EventNameList>] [ip <String>] # [event|events <EventNameList>] [ip <String>]
# [gmaileventtypes <NumberRangeList>] # [groupidfilter <String>]
# [groupidfilter <String>] [resourcedetailsfilter <String>]
# [notimesort]
# [maxactivities <Number>] [maxevents <Number>] [maxresults <Number>] # [maxactivities <Number>] [maxevents <Number>] [maxresults <Number>]
# [countsonly [bydate|summary] [eventrowfilter]] # [countsonly [bydate|summary] [eventrowfilter]]
# (addcsvdata <FieldName> <String>)* [shownoactivities] # (addcsvdata <FieldName> <String>)* [shownoactivities]
@@ -14141,7 +14120,6 @@ def doReport():
maxResults = 1000 maxResults = 1000
aggregateByDate = aggregateByUser = convertMbToGb = countsOnly = countsByDate = countsSummary = \ aggregateByDate = aggregateByUser = convertMbToGb = countsOnly = countsByDate = countsSummary = \
eventRowFilter = exitUserLoop = noAuthorizedApps = normalizeUsers = select = userCustomerRange = False eventRowFilter = exitUserLoop = noAuthorizedApps = normalizeUsers = select = userCustomerRange = False
sortAllTimes = True
limitDateChanges = -1 limitDateChanges = -1
allVerifyUser = userKey = 'all' allVerifyUser = userKey = 'all'
cd = orgUnit = orgUnitId = None cd = orgUnit = orgUnitId = None
@@ -14239,8 +14217,6 @@ def doReport():
eventNames.append(event) eventNames.append(event)
elif activityReports and myarg == 'ip': elif activityReports and myarg == 'ip':
actorIpAddress = getString(Cmd.OB_STRING) actorIpAddress = getString(Cmd.OB_STRING)
elif activityReports and myarg == 'notimesort':
sortAllTimes = False
elif activityReports and myarg == 'countsonly': elif activityReports and myarg == 'countsonly':
countsOnly = True countsOnly = True
elif activityReports and myarg == 'bydate': elif activityReports and myarg == 'bydate':
@@ -14706,8 +14682,6 @@ def doReport():
if addCSVData: if addCSVData:
row.update(addCSVData) row.update(addCSVData)
csvPF.WriteRowTitles(row) csvPF.WriteRowTitles(row)
elif sortAllTimes:
csvPF.SortRows('id.time', True)
else: else:
if eventRowFilter: if eventRowFilter:
csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE]) csvPF.SetRowFilter([], GC.Values[GC.CSV_OUTPUT_ROW_FILTER_MODE])
@@ -16996,13 +16970,12 @@ def doCreateUpdateAdminRoles():
if not updateCmd: if not updateCmd:
result = callGAPI(cd.roles(), 'insert', result = callGAPI(cd.roles(), 'insert',
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED]+[GAPI.DUPLICATE, GAPI.INVALID, GAPI.REQUIRED], GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED]+[GAPI.DUPLICATE],
customer=GC.Values[GC.CUSTOMER_ID], body=body, fields=fieldsList) customer=GC.Values[GC.CUSTOMER_ID], body=body, fields=fieldsList)
else: else:
result = callGAPI(cd.roles(), 'patch', result = callGAPI(cd.roles(), 'patch',
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND,
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION, GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED]+[GAPI.NOT_FOUND, GAPI.FAILED_PRECONDITION, GAPI.CONFLICT],
GAPI.CONFLICT, GAPI.INVALID, GAPI.REQUIRED],
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, body=body, fields=fieldsList) customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, body=body, fields=fieldsList)
if not csvPF: if not csvPF:
entityActionPerformed([Ent.ADMIN_ROLE, f"{result['roleName']}({result['roleId']})"]) entityActionPerformed([Ent.ADMIN_ROLE, f"{result['roleName']}({result['roleId']})"])
@@ -17020,7 +16993,7 @@ def doCreateUpdateAdminRoles():
row.update(addCSVData) row.update(addCSVData)
row['JSON'] = json.dumps(cleanJSON(result), ensure_ascii=False, sort_keys=True) row['JSON'] = json.dumps(cleanJSON(result), ensure_ascii=False, sort_keys=True)
csvPF.WriteRowNoFilter(row) csvPF.WriteRowNoFilter(row)
except (GAPI.duplicate, GAPI.invalid, GAPI.required) as e: except GAPI.duplicate as e:
entityActionFailedWarning([Ent.ADMIN_ROLE, f"{body['roleName']}"], str(e)) entityActionFailedWarning([Ent.ADMIN_ROLE, f"{body['roleName']}"], str(e))
except (GAPI.notFound, GAPI.failedPrecondition, GAPI.conflict) as e: except (GAPI.notFound, GAPI.failedPrecondition, GAPI.conflict) as e:
entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e)) entityActionFailedWarning([Ent.ADMIN_ROLE, roleId], str(e))
@@ -34873,14 +34846,13 @@ def finalizeInternalDomains(cd, internalDomains):
return internalDomains return internalDomains
def finalizeIPSGMGroupRolesMemberDisplayOptions(cd, memberDisplayOptions, verifyAllowExternal): def finalizeIPSGMGroupRolesMemberDisplayOptions(cd, memberDisplayOptions, verifyAllowExternal):
memberDisplayOptions['internalDomains'] = finalizeInternalDomains(cd, memberDisplayOptions['internalDomains'])
if verifyAllowExternal: if verifyAllowExternal:
memberDisplayOptions['external'] = memberDisplayOptions['checkCategory'] = memberDisplayOptions['showCategory'] = True memberDisplayOptions['external'] = memberDisplayOptions['checkCategory'] = memberDisplayOptions['showCategory'] = True
memberDisplayOptions['internal'] = False memberDisplayOptions['internal'] = False
if memberDisplayOptions['showCategory']: if memberDisplayOptions['showCategory']:
memberDisplayOptions['gs'] = buildGAPIObject(API.GROUPSSETTINGS) memberDisplayOptions['gs'] = buildGAPIObject(API.GROUPSSETTINGS)
memberDisplayOptions['checkShowCategory'] = memberDisplayOptions['checkCategory'] or memberDisplayOptions['showCategory'] memberDisplayOptions['checkShowCategory'] = memberDisplayOptions['checkCategory'] or memberDisplayOptions['showCategory']
if memberDisplayOptions['checkShowCategory']:
memberDisplayOptions['internalDomains'] = finalizeInternalDomains(cd, memberDisplayOptions['internalDomains'])
return memberDisplayOptions['showCategory'], memberDisplayOptions['checkShowCategory'] return memberDisplayOptions['showCategory'], memberDisplayOptions['checkShowCategory']
GROUP_FIELDS_CHOICE_MAP = { GROUP_FIELDS_CHOICE_MAP = {
@@ -37826,7 +37798,7 @@ def doCreateUpdateCIPolicy():
updateCmd = Act.Get() == Act.UPDATE updateCmd = Act.Get() == Act.UPDATE
groupEmail = orgUnit = None groupEmail = orgUnit = None
checkArgumentPresent('json', True) checkArgumentPresent('json', True)
jsonData = getJSON(['customer', 'type']) jsonData = getJSON(['type'])
if updateCmd: if updateCmd:
pname = jsonData.pop('name', None) pname = jsonData.pop('name', None)
else: else:
@@ -46004,13 +45976,10 @@ def doCreateGuestUser():
checkForExtraneousArguments() checkForExtraneousArguments()
try: try:
result = callGAPI(cd.users(), 'createGuest', result = callGAPI(cd.users(), 'createGuest',
throwReasons=[GAPI.FAILED_PRECONDITION, GAPI.INVALID_ARGUMENT], throwReasons=[GAPI.FAILED_PRECONDITION],
body=body) body=body)
entityActionPerformed([Ent.GUEST_USER, body['primaryGuestEmail']]) entityActionPerformed([Ent.GUEST_USER, result['primaryGuestEmail']])
Ind.Increment() except (GAPI.failedPrecondition) as e:
showJSON(None, result)
Ind.Decrement()
except (GAPI.failedPrecondition, GAPI.invalidArgument) as e:
entityActionFailedExit([Ent.GUEST_USER, body['primaryGuestEmail']], str(e)) entityActionFailedExit([Ent.GUEST_USER, body['primaryGuestEmail']], str(e))
# gam <UserTypeEntity> update user <UserAttribute>* # gam <UserTypeEntity> update user <UserAttribute>*
@@ -46622,9 +46591,8 @@ USER_FIELDS_CHOICE_MAP = {
'firstname': 'name.givenName', 'firstname': 'name.givenName',
'fullname': 'name.fullName', 'fullname': 'name.fullName',
'gal': 'includeInGlobalAddressList', 'gal': 'includeInGlobalAddressList',
'gender': ['gender.type', 'gender.customGender', 'gender.addressMeAs'],
'givenname': 'name.givenName', 'givenname': 'name.givenName',
'guestaccountinfo': 'guestAccountInfo', 'gender': ['gender.type', 'gender.customGender', 'gender.addressMeAs'],
'id': 'id', 'id': 'id',
'im': 'ims', 'im': 'ims',
'ims': 'ims', 'ims': 'ims',
@@ -46634,7 +46602,6 @@ USER_FIELDS_CHOICE_MAP = {
'isdelegatedadmin': ['isAdmin', 'isDelegatedAdmin'], 'isdelegatedadmin': ['isAdmin', 'isDelegatedAdmin'],
'isenforcedin2sv': 'isEnforcedIn2Sv', 'isenforcedin2sv': 'isEnforcedIn2Sv',
'isenrolledin2sv': 'isEnrolledIn2Sv', 'isenrolledin2sv': 'isEnrolledIn2Sv',
'isguestuser': 'isGuestUser',
'is2svenforced': 'isEnforcedIn2Sv', 'is2svenforced': 'isEnforcedIn2Sv',
'is2svenrolled': 'isEnrolledIn2Sv', 'is2svenrolled': 'isEnrolledIn2Sv',
'ismailboxsetup': 'isMailboxSetup', 'ismailboxsetup': 'isMailboxSetup',
@@ -51398,6 +51365,8 @@ def _batchAddItemsToCourse(croom, courseId, i, count, addItems, addType):
errMsg = getPhraseDNEorSNA(riItem) errMsg = getPhraseDNEorSNA(riItem)
else: else:
errMsg = getHTTPError(_ADD_PART_REASON_TO_MESSAGE_MAP, http_status, reason, message) errMsg = getHTTPError(_ADD_PART_REASON_TO_MESSAGE_MAP, http_status, reason, message)
if (reason == GAPI.PERMISSION_DENIED) and (addType in {Ent.STUDENT, Ent.TEACHER}) and ('CannotDirectAddUser' in errMsg):
errMsg += f' Add external user with: gam user {riItem} create classroominvitation courses {ri[RI_ENTITY]} addType {Ent.Singular(addType)}'
entityActionFailedWarning([Ent.COURSE, ri[RI_ENTITY], addType, riItem], errMsg, int(ri[RI_J]), int(ri[RI_JCOUNT])) entityActionFailedWarning([Ent.COURSE, ri[RI_ENTITY], addType, riItem], errMsg, int(ri[RI_J]), int(ri[RI_JCOUNT]))
return return
waitOnFailure(1, 10, reason, message) waitOnFailure(1, 10, reason, message)
@@ -62065,7 +62034,6 @@ def initCopyMoveOptions(copyCmd):
'copyFilePermissions': False, 'copyFilePermissions': False,
'copyFileInheritedPermissions': True, 'copyFileInheritedPermissions': True,
'copyFileNonInheritedPermissions': COPY_NONINHERITED_PERMISSIONS_ALWAYS, 'copyFileNonInheritedPermissions': COPY_NONINHERITED_PERMISSIONS_ALWAYS,
'copyFolderPermissions': True,
'copyMergeWithParentFolderPermissions': False, 'copyMergeWithParentFolderPermissions': False,
'copyMergedTopFolderPermissions': copyCmd, 'copyMergedTopFolderPermissions': copyCmd,
'copyMergedSubFolderPermissions': copyCmd, 'copyMergedSubFolderPermissions': copyCmd,
@@ -62143,8 +62111,6 @@ def getCopyMoveOptions(myarg, copyMoveOptions):
copyMoveOptions['duplicateFiles'] = getChoice(DUPLICATE_FILE_CHOICES, mapChoice=True) copyMoveOptions['duplicateFiles'] = getChoice(DUPLICATE_FILE_CHOICES, mapChoice=True)
elif myarg == 'duplicatefolders': elif myarg == 'duplicatefolders':
copyMoveOptions['duplicateFolders'] = getChoice(DUPLICATE_FOLDER_CHOICES, mapChoice=True) copyMoveOptions['duplicateFolders'] = getChoice(DUPLICATE_FOLDER_CHOICES, mapChoice=True)
elif myarg == 'copyfolderpermissions':
copyMoveOptions['copyFolderPermissions'] = getBoolean()
elif myarg == 'copymergewithparentfolderpermissions': elif myarg == 'copymergewithparentfolderpermissions':
copyMoveOptions['copyMergeWithParentFolderPermissions'] = getBoolean() copyMoveOptions['copyMergeWithParentFolderPermissions'] = getBoolean()
elif myarg == 'copymergedtopfolderpermissions': elif myarg == 'copymergedtopfolderpermissions':
@@ -62823,7 +62789,6 @@ copyReturnItemMap = {
# [copyfilepermissions [<Boolean>]] # [copyfilepermissions [<Boolean>]]
# [copyfileinheritedpermissions [<Boolean>] # [copyfileinheritedpermissions [<Boolean>]
# [copyfilenoninheritedpermissions [<Boolean>] # [copyfilenoninheritedpermissions [<Boolean>]
# [copyfolderpermissions [<Boolean>]]
# [copymergewithparentfolderpermissions [<Boolean>]] # [copymergewithparentfolderpermissions [<Boolean>]]
# [copymergedtopfolderpermissions [<Boolean>]] # [copymergedtopfolderpermissions [<Boolean>]]
# [copytopfolderpermissions [<Boolean>]] # [copytopfolderpermissions [<Boolean>]]
@@ -62871,8 +62836,7 @@ def copyDriveFile(users):
_writeCSVData(user, folderName, folderId, newParentName, newParentId, MIMETYPE_GA_FOLDER) _writeCSVData(user, folderName, folderId, newParentName, newParentId, MIMETYPE_GA_FOLDER)
Act.Set(action) Act.Set(action)
_incrStatistic(statistics, STAT_FOLDER_MERGED) _incrStatistic(statistics, STAT_FOLDER_MERGED)
if (copyMoveOptions['copyFolderPermissions'] and if (copyMoveOptions['copyMergeWithParentFolderPermissions'] and
copyMoveOptions['copyMergeWithParentFolderPermissions'] and
copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT): copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT):
copyFolderNonInheritedPermissions =\ copyFolderNonInheritedPermissions =\
_getCopyFolderNonInheritedPermissions(copyMoveOptions, _getCopyFolderNonInheritedPermissions(copyMoveOptions,
@@ -62902,8 +62866,7 @@ def copyDriveFile(users):
_writeCSVData(user, folderName, folderId, newFolderName, newFolderId, MIMETYPE_GA_FOLDER) _writeCSVData(user, folderName, folderId, newFolderName, newFolderId, MIMETYPE_GA_FOLDER)
Act.Set(action) Act.Set(action)
_incrStatistic(statistics, STAT_FOLDER_MERGED) _incrStatistic(statistics, STAT_FOLDER_MERGED)
if (copyMoveOptions['copyFolderPermissions'] and if (copyMoveOptions[['copyMergedSubFolderPermissions', 'copyMergedTopFolderPermissions'][atTop]] and
copyMoveOptions[['copyMergedSubFolderPermissions', 'copyMergedTopFolderPermissions'][atTop]] and
(not atTop or copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT)): (not atTop or copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT)):
copyFolderNonInheritedPermissions =\ copyFolderNonInheritedPermissions =\
_getCopyFolderNonInheritedPermissions(copyMoveOptions, _getCopyFolderNonInheritedPermissions(copyMoveOptions,
@@ -62955,8 +62918,7 @@ def copyDriveFile(users):
else: else:
_writeCSVData(user, folderName, folderId, newFolderName, newFolderId, body['mimeType']) _writeCSVData(user, folderName, folderId, newFolderName, newFolderId, body['mimeType'])
_incrStatistic(statistics, STAT_FOLDER_COPIED_MOVED) _incrStatistic(statistics, STAT_FOLDER_COPIED_MOVED)
if (copyMoveOptions['copyFolderPermissions'] and if copyMoveOptions[['copySubFolderPermissions', 'copyTopFolderPermissions'][atTop]]:
copyMoveOptions[['copySubFolderPermissions', 'copyTopFolderPermissions'][atTop]]):
_copyPermissions(drive, user, i, count, j, jcount, _copyPermissions(drive, user, i, count, j, jcount,
Ent.DRIVE_FOLDER, folderId, folderName, newFolderId, newFolderName, Ent.DRIVE_FOLDER, folderId, folderName, newFolderId, newFolderName,
statistics, STAT_FOLDER_PERMISSIONS_FAILED, statistics, STAT_FOLDER_PERMISSIONS_FAILED,
@@ -63711,7 +63673,6 @@ def _recursiveUpdateMovePermissions(drive, user, i, count,
# [createshortcutsfornonmovablefiles [<Boolean>]] # [createshortcutsfornonmovablefiles [<Boolean>]]
# [duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip] # [duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip]
# [duplicatefolders merge|duplicatename|uniquename|skip] # [duplicatefolders merge|duplicatename|uniquename|skip]
# [copyfolderpermissions [<Boolean>]]
# [copymergewithparentfolderpermissions [<Boolean>]] # [copymergewithparentfolderpermissions [<Boolean>]]
# [copymergedtopfolderpermissions [<Boolean>]] # [copymergedtopfolderpermissions [<Boolean>]]
# [copytopfolderpermissions [<Boolean>]] # [copytopfolderpermissions [<Boolean>]]
@@ -63748,8 +63709,7 @@ def moveDriveFile(users):
entityPerformActionModifierItemValueList(kvList, Act.MODIFIER_CONTENTS_WITH, [Ent.DRIVE_FOLDER, newParentNameId], j, jcount) entityPerformActionModifierItemValueList(kvList, Act.MODIFIER_CONTENTS_WITH, [Ent.DRIVE_FOLDER, newParentNameId], j, jcount)
Act.Set(action) Act.Set(action)
_incrStatistic(statistics, STAT_FOLDER_MERGED) _incrStatistic(statistics, STAT_FOLDER_MERGED)
if (copyMoveOptions['copyFolderPermissions'] and if (copyMoveOptions['copyMergeWithParentFolderPermissions'] and
copyMoveOptions['copyMergeWithParentFolderPermissions'] and
copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT): copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT):
copyFolderNonInheritedPermissions =\ copyFolderNonInheritedPermissions =\
_getCopyFolderNonInheritedPermissions(copyMoveOptions, _getCopyFolderNonInheritedPermissions(copyMoveOptions,
@@ -63779,8 +63739,7 @@ def moveDriveFile(users):
entityModifierItemValueListActionPerformed(kvList, Act.MODIFIER_CONTENTS_WITH, [Ent.DRIVE_FOLDER, f'{newFolderName}({newFolderId})'], j, jcount) entityModifierItemValueListActionPerformed(kvList, Act.MODIFIER_CONTENTS_WITH, [Ent.DRIVE_FOLDER, f'{newFolderName}({newFolderId})'], j, jcount)
Act.Set(action) Act.Set(action)
_incrStatistic(statistics, STAT_FOLDER_MERGED) _incrStatistic(statistics, STAT_FOLDER_MERGED)
if (copyMoveOptions['copyFolderPermissions'] and if (copyMoveOptions[['copyMergedSubFolderPermissions', 'copyMergedTopFolderPermissions'][atTop]] and
copyMoveOptions[['copyMergedSubFolderPermissions', 'copyMergedTopFolderPermissions'][atTop]] and
(not atTop or copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT)): (not atTop or copyMoveOptions['destParentType'] != DEST_PARENT_MYDRIVE_ROOT)):
copyFolderNonInheritedPermissions =\ copyFolderNonInheritedPermissions =\
_getCopyFolderNonInheritedPermissions(copyMoveOptions, _getCopyFolderNonInheritedPermissions(copyMoveOptions,
@@ -63874,8 +63833,7 @@ def moveDriveFile(users):
j, jcount) j, jcount)
Act.Set(action) Act.Set(action)
_incrStatistic(statistics, STAT_FOLDER_COPIED_MOVED) _incrStatistic(statistics, STAT_FOLDER_COPIED_MOVED)
if (copyMoveOptions['copyFolderPermissions'] and if copyMoveOptions[['copySubFolderPermissions', 'copyTopFolderPermissions'][atTop]]:
copyMoveOptions[['copySubFolderPermissions', 'copyTopFolderPermissions'][atTop]]):
_copyPermissions(drive, user, i, count, j, jcount, _copyPermissions(drive, user, i, count, j, jcount,
Ent.DRIVE_FOLDER, folderId, folderName, newFolderId, newFolderName, Ent.DRIVE_FOLDER, folderId, folderName, newFolderId, newFolderName,
statistics, STAT_FOLDER_PERMISSIONS_FAILED, statistics, STAT_FOLDER_PERMISSIONS_FAILED,
@@ -66799,29 +66757,6 @@ def _checkFileIdEntityDomainAccess(fileIdEntity, useDomainAdminAccess):
# [sendemail|sendnotification] [emailmessage <String>] # [sendemail|sendnotification] [emailmessage <String>]
# [showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])] # [showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])]
def createDriveFileACL(users, useDomainAdminAccess=False): def createDriveFileACL(users, useDomainAdminAccess=False):
def _showResult(permission, showAction):
if updateSheetProtectedRanges and mimeType == MIMETYPE_GA_SPREADSHEET:
_updateSheetProtectedRangesACLchange(sheet, user, i, count, j, jcount, fileId, fileName, True, permission)
if csvPF:
baserow = {'Owner': user, 'id': fileId}
if showTitles:
baserow['name'] = fileName
row = baserow.copy()
_mapDrivePermissionNames(permission)
flattenJSON({'permission': permission}, flattened=row, timeObjects=timeObjects)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
row = baserow.copy()
row['JSON'] = json.dumps(cleanJSON({'permission': permission}, timeObjects=timeObjects),
ensure_ascii=False, sort_keys=True)
csvPF.WriteRowNoFilter(row)
else:
if showAction:
entityActionPerformed([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], j, jcount)
if showDetails:
_showDriveFilePermission(permission, printKeys, timeObjects)
moveToNewOwnersRoot = False moveToNewOwnersRoot = False
sendNotificationEmail = showTitles = _transferOwnership = updateSheetProtectedRanges = False sendNotificationEmail = showTitles = _transferOwnership = updateSheetProtectedRanges = False
roleLocation = withLinkLocation = expirationLocation = None roleLocation = withLinkLocation = expirationLocation = None
@@ -66931,30 +66866,35 @@ def createDriveFileACL(users, useDomainAdminAccess=False):
_, sheet = buildGAPIServiceObject(API.SHEETS, user, i, count) _, sheet = buildGAPIServiceObject(API.SHEETS, user, i, count)
if not sheet: if not sheet:
break break
try: permission = callGAPI(drive.permissions(), 'create',
permission = callGAPI(drive.permissions(), 'create', bailOnInternalError=True,
bailOnInternalError=True, throwReasons=GAPI.DRIVE_ACCESS_THROW_REASONS+GAPI.DRIVE3_CREATE_ACL_THROW_REASONS+[GAPI.FILE_NEVER_WRITABLE],
throwReasons=GAPI.DRIVE_ACCESS_THROW_REASONS+GAPI.DRIVE3_CREATE_ACL_THROW_REASONS+[GAPI.FILE_NEVER_WRITABLE], moveToNewOwnersRoot=moveToNewOwnersRoot,
moveToNewOwnersRoot=moveToNewOwnersRoot, useDomainAdminAccess=useDomainAdminAccess,
useDomainAdminAccess=useDomainAdminAccess, fileId=fileId, sendNotificationEmail=sendNotificationEmail, emailMessage=emailMessage,
fileId=fileId, sendNotificationEmail=sendNotificationEmail, emailMessage=emailMessage, transferOwnership=_transferOwnership, body=body, fields='*', supportsAllDrives=True)
transferOwnership=_transferOwnership, body=body, fields='*', supportsAllDrives=True) if updateSheetProtectedRanges and mimeType == MIMETYPE_GA_SPREADSHEET:
_showResult(permission, True) _updateSheetProtectedRangesACLchange(sheet, user, i, count, j, jcount, fileId, fileName, True, permission)
except GAPI.invalidSharingRequest as e: if csvPF:
errMsg = str(e) baserow = {'Owner': user, 'id': fileId}
if ('successfully shared but emails could not be sent' not in errMsg) or ('emailAddress' not in body): if showTitles:
entityActionFailedWarning([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], errMsg, j, jcount) baserow['name'] = fileName
else: row = baserow.copy()
if not csvPF: _mapDrivePermissionNames(permission)
entityActionPerformedMessage([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], errMsg, j, jcount) flattenJSON({'permission': permission}, flattened=row, timeObjects=timeObjects)
tempPermId = getPermissionIdForEmail(user, i, count, body['emailAddress']) if not FJQC.formatJSON:
permission = callGAPI(drive.permissions(), 'get', csvPF.WriteRowTitles(row)
throwReasons=GAPI.DRIVE_ACCESS_THROW_REASONS+[GAPI.BAD_REQUEST, GAPI.PERMISSION_NOT_FOUND, GAPI.INSUFFICIENT_ADMINISTRATOR_PRIVILEGES], elif csvPF.CheckRowTitles(row):
useDomainAdminAccess=useDomainAdminAccess, row = baserow.copy()
fileId=fileId, permissionId=tempPermId, fields='*', supportsAllDrives=True) row['JSON'] = json.dumps(cleanJSON({'permission': permission}, timeObjects=timeObjects),
_showResult(permission, False) ensure_ascii=False, sort_keys=True)
csvPF.WriteRowNoFilter(row)
else:
entityActionPerformed([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], j, jcount)
if showDetails:
_showDriveFilePermission(permission, printKeys, timeObjects)
except (GAPI.badRequest, GAPI.invalid, GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, except (GAPI.badRequest, GAPI.invalid, GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError,
GAPI.permissionNotFound, GAPI.cannotSetExpiration, GAPI.cannotSetExpirationOnAnyoneOrDomain, GAPI.cannotSetExpiration, GAPI.cannotSetExpirationOnAnyoneOrDomain,
GAPI.expirationDateNotAllowedForSharedDriveMembers, GAPI.expirationDatesMustBeInTheFuture, GAPI.expirationDateNotAllowedForSharedDriveMembers, GAPI.expirationDatesMustBeInTheFuture,
GAPI.insufficientFilePermissions, GAPI.unknownError, GAPI.ownershipChangeAcrossDomainNotPermitted, GAPI.insufficientFilePermissions, GAPI.unknownError, GAPI.ownershipChangeAcrossDomainNotPermitted,
GAPI.teamDriveDomainUsersOnlyRestriction, GAPI.teamDriveTeamMembersOnlyRestriction, GAPI.teamDriveDomainUsersOnlyRestriction, GAPI.teamDriveTeamMembersOnlyRestriction,
@@ -66968,7 +66908,7 @@ def createDriveFileACL(users, useDomainAdminAccess=False):
GAPI.fileOrganizerOnNonTeamDriveNotSupported, GAPI.fileOrganizerOnNonTeamDriveNotSupported,
GAPI.cannotModifyInheritedPermission, GAPI.cannotModifyInheritedPermission,
GAPI.teamDrivesFolderSharingNotSupported, GAPI.invalidLinkVisibility, GAPI.teamDrivesFolderSharingNotSupported, GAPI.invalidLinkVisibility,
GAPI.fileNeverWritable, GAPI.abusiveContentRestriction) as e: GAPI.invalidSharingRequest, GAPI.fileNeverWritable, GAPI.abusiveContentRestriction) as e:
entityActionFailedWarning([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], str(e), j, jcount) entityActionFailedWarning([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], str(e), j, jcount)
except GAPI.notFound as e: except GAPI.notFound as e:
entityActionFailedWarning([Ent.USER, user, Ent.SHAREDDRIVE, fileName], str(e), j, jcount) entityActionFailedWarning([Ent.USER, user, Ent.SHAREDDRIVE, fileName], str(e), j, jcount)
@@ -66987,29 +66927,6 @@ def doCreateDriveFileACL():
# [updatesheetprotectedranges [<Boolean>]] [enforceexpansiveaccess [<Boolean>]] # [updatesheetprotectedranges [<Boolean>]] [enforceexpansiveaccess [<Boolean>]]
# [showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])] # [showtitles] [nodetails|(csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]])]
def updateDriveFileACLs(users, useDomainAdminAccess=False): def updateDriveFileACLs(users, useDomainAdminAccess=False):
def _showResult(permission, showAction):
if updateSheetProtectedRanges and mimeType == MIMETYPE_GA_SPREADSHEET:
_updateSheetProtectedRangesACLchange(sheet, user, i, count, j, jcount, fileId, fileName, True, permission)
if csvPF:
baserow = {'Owner': user, 'id': fileId}
if showTitles:
baserow['name'] = fileName
row = baserow.copy()
_mapDrivePermissionNames(permission)
flattenJSON({'permission': permission}, flattened=row, timeObjects=timeObjects)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
row = baserow.copy()
row['JSON'] = json.dumps(cleanJSON({'permission': permission}, timeObjects=timeObjects),
ensure_ascii=False, sort_keys=True)
csvPF.WriteRowNoFilter(row)
else:
if showAction:
entityActionPerformed([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], j, jcount)
if showDetails:
_showDriveFilePermission(permission, printKeys, timeObjects)
fileIdEntity = getDriveFileEntity() fileIdEntity = getDriveFileEntity()
isEmail, permissionId = getPermissionId() isEmail, permissionId = getPermissionId()
enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS] enforceExpansiveAccess = GC.Values[GC.ENFORCE_EXPANSIVE_ACCESS]
@@ -67089,7 +67006,26 @@ def updateDriveFileACLs(users, useDomainAdminAccess=False):
useDomainAdminAccess=useDomainAdminAccess, enforceExpansiveAccess=enforceExpansiveAccess, useDomainAdminAccess=useDomainAdminAccess, enforceExpansiveAccess=enforceExpansiveAccess,
fileId=fileId, permissionId=permissionId, removeExpiration=removeExpiration, fileId=fileId, permissionId=permissionId, removeExpiration=removeExpiration,
transferOwnership=body.get('role', '') == 'owner', body=body, fields='*', supportsAllDrives=True) transferOwnership=body.get('role', '') == 'owner', body=body, fields='*', supportsAllDrives=True)
_showResult(permission, True) if updateSheetProtectedRanges and mimeType == MIMETYPE_GA_SPREADSHEET:
_updateSheetProtectedRangesACLchange(sheet, user, i, count, j, jcount, fileId, fileName, True, permission)
if csvPF:
baserow = {'Owner': user, 'id': fileId}
if showTitles:
baserow['name'] = fileName
row = baserow.copy()
_mapDrivePermissionNames(permission)
flattenJSON({'permission': permission}, flattened=row, timeObjects=timeObjects)
if not FJQC.formatJSON:
csvPF.WriteRowTitles(row)
elif csvPF.CheckRowTitles(row):
row = baserow.copy()
row['JSON'] = json.dumps(cleanJSON({'permission': permission}, timeObjects=timeObjects),
ensure_ascii=False, sort_keys=True)
csvPF.WriteRowNoFilter(row)
else:
entityActionPerformed([Ent.USER, user, entityType, fileName, Ent.PERMISSION_ID, permissionId], j, jcount)
if showDetails:
_showDriveFilePermission(permission, printKeys, timeObjects)
except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError, except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
GAPI.cannotSetExpiration, GAPI.cannotSetExpirationOnAnyoneOrDomain, GAPI.cannotSetExpiration, GAPI.cannotSetExpirationOnAnyoneOrDomain,
GAPI.expirationDateNotAllowedForSharedDriveMembers, GAPI.expirationDatesMustBeInTheFuture, GAPI.expirationDateNotAllowedForSharedDriveMembers, GAPI.expirationDatesMustBeInTheFuture,
@@ -71335,13 +71271,6 @@ def updatePhoto(users):
continue continue
body = {'photoData': base64.urlsafe_b64encode(image_data).decode(UTF8)} body = {'photoData': base64.urlsafe_b64encode(image_data).decode(UTF8)}
try: try:
try:
callGAPI(cd.users().photos(), 'delete',
bailOnInternalError=True,
throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.PHOTO_NOT_FOUND, GAPI.INTERNAL_ERROR],
userKey=user)
except (GAPI.photoNotFound, GAPI.internalError) as e:
pass
callGAPI(cd.users().photos(), 'update', callGAPI(cd.users().photos(), 'update',
throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.INVALID_INPUT, GAPI.CONDITION_NOT_MET], throwReasons=[GAPI.USER_NOT_FOUND, GAPI.FORBIDDEN, GAPI.INVALID_INPUT, GAPI.CONDITION_NOT_MET],
userKey=user, body=body, fields='') userKey=user, body=body, fields='')

View File

@@ -649,16 +649,6 @@ _SVCACCT_SCOPES = [
'api': CLOUDIDENTITY_DEVICES, 'api': CLOUDIDENTITY_DEVICES,
'subscopes': READONLY, 'subscopes': READONLY,
'scope': 'https://www.googleapis.com/auth/cloud-identity.devices'}, 'scope': 'https://www.googleapis.com/auth/cloud-identity.devices'},
# {'name': 'Cloud Identity API - Policy',
# 'api': CLOUDIDENTITY_POLICY,
# 'subscopes': READONLY,
# 'roByDefault': True,
# 'scope': 'https://www.googleapis.com/auth/cloud-identity.policies'},
# {'name': 'Cloud Identity API - Policy Beta',
# 'api': CLOUDIDENTITY_POLICY_BETA,
# 'subscopes': [],
# 'offByDefault': True,
# 'scope': 'https://www.googleapis.com/auth/cloud-identity.policies'},
# {'name': 'Cloud Identity User Invitations API', # {'name': 'Cloud Identity User Invitations API',
# 'api': CLOUDIDENTITY_USERINVITATIONS, # 'api': CLOUDIDENTITY_USERINVITATIONS,
# 'subscopes': READONLY, # 'subscopes': READONLY,

View File

@@ -331,7 +331,7 @@ CSV_INPUT_ROW_FILTER_ITEMS = {CSV_INPUT_ROW_FILTER, CSV_INPUT_ROW_FILTER_MODE,
CSV_OUTPUT_ROW_FILTER_ITEMS = {CSV_OUTPUT_HEADER_FILTER, CSV_OUTPUT_HEADER_DROP_FILTER, CSV_OUTPUT_ROW_FILTER_ITEMS = {CSV_OUTPUT_HEADER_FILTER, CSV_OUTPUT_HEADER_DROP_FILTER,
CSV_OUTPUT_HEADER_FORCE, CSV_OUTPUT_HEADER_ORDER, CSV_OUTPUT_HEADER_FORCE, CSV_OUTPUT_HEADER_ORDER,
CSV_OUTPUT_HEADER_REQUIRED, # CSV_OUTPUT_HEADER_REQUIRED,
CSV_OUTPUT_ROW_FILTER, CSV_OUTPUT_ROW_FILTER_MODE, CSV_OUTPUT_ROW_FILTER, CSV_OUTPUT_ROW_FILTER_MODE,
CSV_OUTPUT_ROW_DROP_FILTER, CSV_OUTPUT_ROW_DROP_FILTER_MODE, CSV_OUTPUT_ROW_DROP_FILTER, CSV_OUTPUT_ROW_DROP_FILTER_MODE,
CSV_OUTPUT_ROW_LIMIT} CSV_OUTPUT_ROW_LIMIT}
@@ -376,7 +376,7 @@ Defaults = {
CSV_OUTPUT_HEADER_DROP_FILTER: '', CSV_OUTPUT_HEADER_DROP_FILTER: '',
CSV_OUTPUT_HEADER_FORCE: '', CSV_OUTPUT_HEADER_FORCE: '',
CSV_OUTPUT_HEADER_ORDER: '', CSV_OUTPUT_HEADER_ORDER: '',
CSV_OUTPUT_HEADER_REQUIRED: '', # CSV_OUTPUT_HEADER_REQUIRED: '',
CSV_OUTPUT_LINE_TERMINATOR: 'lf', CSV_OUTPUT_LINE_TERMINATOR: 'lf',
CSV_OUTPUT_QUOTE_CHAR: '\'"\'', CSV_OUTPUT_QUOTE_CHAR: '\'"\'',
CSV_OUTPUT_ROW_FILTER: '', CSV_OUTPUT_ROW_FILTER: '',
@@ -550,7 +550,7 @@ VAR_INFO = {
CSV_OUTPUT_HEADER_DROP_FILTER: {VAR_TYPE: TYPE_HEADERFILTER}, CSV_OUTPUT_HEADER_DROP_FILTER: {VAR_TYPE: TYPE_HEADERFILTER},
CSV_OUTPUT_HEADER_FORCE: {VAR_TYPE: TYPE_HEADERFORCEREQUIRED}, CSV_OUTPUT_HEADER_FORCE: {VAR_TYPE: TYPE_HEADERFORCEREQUIRED},
CSV_OUTPUT_HEADER_ORDER: {VAR_TYPE: TYPE_HEADERORDER}, CSV_OUTPUT_HEADER_ORDER: {VAR_TYPE: TYPE_HEADERORDER},
CSV_OUTPUT_HEADER_REQUIRED: {VAR_TYPE: TYPE_HEADERFORCEREQUIRED}, # CSV_OUTPUT_HEADER_REQUIRED: {VAR_TYPE: TYPE_HEADERFORCEREQUIRED},
CSV_OUTPUT_LINE_TERMINATOR: {VAR_TYPE: TYPE_CHOICE, VAR_CHOICES: {'cr': '\r', 'lf': '\n', 'crlf': '\r\n'}}, CSV_OUTPUT_LINE_TERMINATOR: {VAR_TYPE: TYPE_CHOICE, VAR_CHOICES: {'cr': '\r', 'lf': '\n', 'crlf': '\r\n'}},
CSV_OUTPUT_QUOTE_CHAR: {VAR_TYPE: TYPE_CHARACTER}, CSV_OUTPUT_QUOTE_CHAR: {VAR_TYPE: TYPE_CHARACTER},
CSV_OUTPUT_ROW_FILTER: {VAR_TYPE: TYPE_ROWFILTER}, CSV_OUTPUT_ROW_FILTER: {VAR_TYPE: TYPE_ROWFILTER},

View File

@@ -129,8 +129,6 @@ GAM_CFG_SECTION_NAME = 'gcsn'
GAM_PATH = 'gpth' GAM_PATH = 'gpth'
# Python source, PyInstaller or StaticX? # Python source, PyInstaller or StaticX?
GAM_TYPE = 'gtyp' GAM_TYPE = 'gtyp'
# Shared Service Account HTTP Object
HTTP_OBJECT = 'http'
# Length of last Got message # Length of last Got message
LAST_GOT_MSG_LEN = 'lgml' LAST_GOT_MSG_LEN = 'lgml'
# License SKUs # License SKUs
@@ -252,7 +250,7 @@ Globals = {
CSV_OUTPUT_HEADER_FILTER: [], CSV_OUTPUT_HEADER_FILTER: [],
CSV_OUTPUT_HEADER_FORCE: [], CSV_OUTPUT_HEADER_FORCE: [],
CSV_OUTPUT_HEADER_ORDER: [], CSV_OUTPUT_HEADER_ORDER: [],
CSV_OUTPUT_HEADER_REQUIRED: [], # CSV_OUTPUT_HEADER_REQUIRED: [],
CSV_OUTPUT_NO_ESCAPE_CHAR: None, CSV_OUTPUT_NO_ESCAPE_CHAR: None,
CSV_OUTPUT_QUOTE_CHAR: None, CSV_OUTPUT_QUOTE_CHAR: None,
CSV_OUTPUT_ROW_DROP_FILTER: [], CSV_OUTPUT_ROW_DROP_FILTER: [],
@@ -284,7 +282,6 @@ Globals = {
GAM_CFG_SECTION_NAME: '', GAM_CFG_SECTION_NAME: '',
GAM_PATH: '.', GAM_PATH: '.',
GAM_TYPE: '', GAM_TYPE: '',
HTTP_OBJECT: None,
LAST_GOT_MSG_LEN: 0, LAST_GOT_MSG_LEN: 0,
LICENSE_SKUS: [], LICENSE_SKUS: [],
MAKE_BUILDING_ID_NAME_MAP: True, MAKE_BUILDING_ID_NAME_MAP: True,

View File

@@ -14,9 +14,8 @@
There are seven values in `gam.cfg` that can be used to filter the output from `gam print` commands. There are seven values in `gam.cfg` that can be used to filter the output from `gam print` commands.
* `csv_output_header_filter` - A list of `<RegularExpressions>` used to select specific column headers to include * `csv_output_header_filter` - A list of `<RegularExpressions>` used to select specific column headers to include
* `csv_output_header_drop_filter` - A list of `<RegularExpressions>` used to select specific column headers to exclude * `csv_output_header_drop_filter` - A list of `<RegularExpressions>` used to select specific column headers to exclude
* `csv_output_header_force` - A list of `<Strings>` used to specify the exact column headers to include * `csv_output_header_force` - A list of <Strings> used to specify the exact column headers to include
* `csv_output_header_order` - A list of `<Strings>` used to specify the column header order; any headers in the file but not in the list will appear after the header* `csv_output_header_required` - A list of `<Strings>` used to specify column headers that are included even if the print command doesn't return them * `csv_output_header_order` - A list of <Strings> used to specify the column header order; any headers in the file but not in the list will appear after the headers in the list.
s in the list.
* `csv_output_row_filter` - A list or JSON dictionary used to include specific rows based on column values * `csv_output_row_filter` - A list or JSON dictionary used to include specific rows based on column values
* `csv_output_row_drop_filter` - A list or JSON dictionary used to exclude specific rows based on column values * `csv_output_row_drop_filter` - A list or JSON dictionary used to exclude specific rows based on column values
* `csv_output_row_limit` - A limit on the number of rows written * `csv_output_row_limit` - A limit on the number of rows written

View File

@@ -319,8 +319,6 @@ Data fields identified in a `csvkmd` argument.
(select <ProjectIDList> | <FileSelector> | <CSVFileSelector>) (select <ProjectIDList> | <FileSelector> | <CSVFileSelector>)
<PrinterIDEntity> ::= <PrinterIDEntity> ::=
<PrinterIDList> | <FileSelector> | <CSVFileSelector> <PrinterIDList> | <FileSelector> | <CSVFileSelector>
<QueryDriveFile> :: = <String> See: https://developers.google.com/workspace/drive/api/guides/search-files
<QuerySharedDrive> ::= <String> See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives
<RecipientEntity> ::= <RecipientEntity> ::=
<EmailAddressEntity> | (select <UserTypeEntity>) <EmailAddressEntity> | (select <UserTypeEntity>)
<ResourceEntity> ::= <ResourceEntity> ::=
@@ -331,22 +329,22 @@ Data fields identified in a `csvkmd` argument.
<SerialNumberList> | <FileSelector> | <CSVFileSelector> <SerialNumberList> | <FileSelector> | <CSVFileSelector>
<SharedDriveIDEntity> ::= <SharedDriveIDEntity> ::=
<DriveFileItem> | <DriveFileItem> |
(shareddriveid <DriveFileItem>) | (shareddriveid:<DriveFileItem>) (teamdriveid <DriveFileItem>) | (teamdriveid:<DriveFileItem>)
<SharedDriveNameEntity> ::= <SharedDriveNameEntity> ::=
(shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveIDEntity> | <SharedDriveIDEntity> |
<SharedDriveNameEntity> <SharedDriveNameEntity>
<SharedDriveAdminQueryEntity> ::= <SharedDriveAdminQueryEntity> ::=
(shareddriveadminquery <QuerySharedDrive>) | (shareddriveadminquery:<QuerySharedDrive>) (teamdriveadminquery <QueryTeamDrive>) | (teamdriveadminquery:<QueryTeamDrive>)
<SharedDriveEntityAdmin> ::= <SharedDriveEntityAdmin> ::=
<SharedDriveIDEntity> | <SharedDriveIDEntity> |
<SharedDriveNameEntity>| <SharedDriveNameEntity>|
<SharedDriveAdminQueryEntity> <SharedDriveAdminQueryEntity>
<SharedDriveFileNameEntity> ::= <SharedDriveFileNameEntity> ::=
(shareddrivefilename <DriveFileName>) | (shareddrivefilename:<DriveFileName>) (teamdrivefilename <DriveFileName>) | (teamdrivefilename:<DriveFileName>)
<SharedDriveFileQueryEntity> ::= <SharedDriveFileQueryEntity> ::=
(shareddrivequery <QueryDriveFile>) | (shareddrivequery:<QueryDriveFile>) (teamdrivequery <QueryDriveFile>) | (teamdrivequery:<QueryDriveFile>)
<SharedDriveFileQueryShortcut> ::= <SharedDriveFileQueryShortcut> ::=
all_files | all_folders | all_google_files | all_non_google_files | all_items all_files | all_folders | all_google_files | all_non_google_files | all_items
<SiteACLScopeEntity> ::= <SiteACLScopeEntity> ::=

View File

@@ -114,9 +114,9 @@ ous_and_children_na_ns
(anydrivefilename <DriveFileName>)|(anydrivefilename:<DriveFileName>) (anydrivefilename <DriveFileName>)|(anydrivefilename:<DriveFileName>)
<SharedDriveID> ::= <String> <SharedDriveID> ::= <String>
<SharedDriveName> ::= <String> <SharedDriveName> ::= <String>
<SharedDriveIDEntity> ::= (shareddriveid <DriveFileItem>) | (shareddriveid:<DriveFileItem>) <SharedDriveIDEntity> ::= (teamdriveid <DriveFileItem>) | (teamdriveid:<DriveFileItem>)
<SharedDriveNameEntity> ::= (shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) <SharedDriveNameEntity> ::= (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
<SharedDriveFileNameEntity> ::= (shareddrivefilename <DriveFileName>) | (shareddrivefilename:<DriveFileName>) <SharedDriveFileNameEntity> ::= (teamdrivefilename <DriveFileName>) | (teamdrivefilename:<DriveFileName>)
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveIDEntity> | <SharedDriveIDEntity> |
<SharedDriveNameEntity> <SharedDriveNameEntity>
@@ -327,7 +327,7 @@ Use these options to select users for GAM commands.
* `ou_arch` - Archived users * `ou_arch` - Archived users
* `ou_ns` - Non-suspended users * `ou_ns` - Non-suspended users
* `ou_susp` - Suspended users * `ou_susp` - Suspended users
* `ou_na_ns` - Non-archived and non-suspended users * `ou_na_ns` - Non-archived and nn-suspended users
## Users in the Organization Unit `<OrgUnitItem>` and all of its sub Organization Units ## Users in the Organization Unit `<OrgUnitItem>` and all of its sub Organization Units
* `ou_and_children|ou_and_children_na|ou_and_children_arch|ou_and_children_ns|ou_and_children_susp|ou_and_children_na_ns <OrgUnitItem>` * `ou_and_children|ou_and_children_na|ou_and_children_arch|ou_and_children_ns|ou_and_children_susp|ou_and_children_na_ns <OrgUnitItem>`
@@ -336,7 +336,7 @@ Use these options to select users for GAM commands.
* `ou_and_children_arch` - Archived users * `ou_and_children_arch` - Archived users
* `ou_and_children_ns` - Non-suspended users * `ou_and_children_ns` - Non-suspended users
* `ou_and_children_susp` - Suspended users * `ou_and_children_susp` - Suspended users
* `ou_and_children_na_ns` - Non-archived and non-suspended users * `ou_and_children_na_ns` - Non-archived and nn-suspended users
## Users directly in the Organization Units `<OrgUnitList>` ## Users directly in the Organization Units `<OrgUnitList>`
* `ous|ous_na|ous_arch|ous_ns|ous_susp|ous_na_ns <OrgUnitList>` - Users directly in the Organization Units `<OrgUnitList>` * `ous|ous_na|ous_arch|ous_ns|ous_susp|ous_na_ns <OrgUnitList>` - Users directly in the Organization Units `<OrgUnitList>`
@@ -345,7 +345,7 @@ Use these options to select users for GAM commands.
* `ous_arch` - Archived users * `ous_arch` - Archived users
* `ous_ns` - Non-suspended users * `ous_ns` - Non-suspended users
* `ous_susp` - Suspended users * `ous_susp` - Suspended users
* `ous_na_ns` - Non-archived and non-suspended users * `ous_na_ns` - Non-archived and nn-suspended users
`<OrgUnitList>` may require special quoting based on whether the OUs contain spaces, commas or single quotes. `<OrgUnitList>` may require special quoting based on whether the OUs contain spaces, commas or single quotes.

View File

@@ -49,8 +49,7 @@
<DriveFolderID> ::= <String> <DriveFolderID> ::= <String>
<DriveFolderIDList> ::= "<DriveFolderID>(,<DriveFolderID>)*" <DriveFolderIDList> ::= "<DriveFolderID>(,<DriveFolderID>)*"
<DriveFolderName> ::= <String> <DriveFolderName> ::= <String>
<QueryDriveFile> :: = <String> See: https://developers.google.com/workspace/drive/api/guides/search-files <QueryDriveFile> :: = <String> See: https://developers.google.com/drive/api/v3/search-files
<QuerySharedDrive> ::= <String> See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives
<DriveFileQueryEntity> ::= <DriveFileQueryEntity> ::=
(query <QueryDriveFile>) | (query:<QueryDriveFile>) (query <QueryDriveFile>) | (query:<QueryDriveFile>)
<DriveFileQueryShortcut> ::= <DriveFileQueryShortcut> ::=
@@ -91,15 +90,15 @@
<SharedDriveID> ::= <String> <SharedDriveID> ::= <String>
<SharedDriveName> ::= <String> <SharedDriveName> ::= <String>
<SharedDriveIDEntity> ::= (shareddriveid <SharedDriveID>) | (shareddriveid:<SharedDriveID>) <SharedDriveIDEntity> ::= (teamdriveid <SharedDriveID>) | (teamdriveid:<SharedDriveID>)
<SharedDriveNameEntity> ::= (shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) <SharedDriveNameEntity> ::= (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
<SharedDriveFileNameEntity> ::= (shareddrivefilename <DriveFileName>) | (shareddrivefilename:<DriveFileName>) <SharedDriveFileNameEntity> ::= (teamdrivefilename <DriveFileName>) | (teamdrivefilename:<DriveFileName>)
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveIDEntity> | <SharedDriveIDEntity> |
<SharedDriveNameEntity> <SharedDriveNameEntity>
<SharedDriveAdminQueryEntity> ::= <SharedDriveAdminQueryEntity> ::=
(shareddriveadminquery <QuerySharedDrive>) | (shareddriveadminquery:<QuerySharedDrive>) (teamdriveadminquery <QueryTeamDrive>) | (teamdriveadminquery:<QueryTeamDrive>)
<SharedDriveFileQueryEntity> ::= <SharedDriveFileQueryEntity> ::=
(query <QueryDriveFile>) | (query:<QueryDriveFile>) (query <QueryDriveFile>) | (query:<QueryDriveFile>)
<SharedDriveFileQueryShortcut> ::= <SharedDriveFileQueryShortcut> ::=
@@ -336,13 +335,13 @@ Select a Shared Drive file by giving its unique ID.
``` ```
<SharedDriveIDEntity> ::= <SharedDriveIDEntity> ::=
<DriveFileItem> | <DriveFileItem> |
(shareddriveid <DriveFileItem>) | (shareddriveid:<DriveFileItem>) (teamdriveid <DriveFileItem>) | (teamdriveid:<DriveFileItem>)
``` ```
### Examples ### Examples
``` ```
gam user testuser show fileinfo 1234ABCD gam user testuser show fileinfo 1234ABCD
gam user testuser show fileinfo id 1234ABCD gam user testuser show fileinfo id 1234ABCD
gam user testuser show fileinfo shareddriveid 1234ABCD gam user testuser show fileinfo teamdriveid 1234ABCD
``` ```
## Select Shared Drive file by name ## Select Shared Drive file by name
If you have the name, a search must be performed to find the ID that matches the name. If you have the name, a search must be performed to find the ID that matches the name.
@@ -351,16 +350,16 @@ You must specify the Shared Drive, either by ID or name, and the name of the fil
Remember, searching for a file by name may return several file IDs if you have multiple files with the same name. Remember, searching for a file by name may return several file IDs if you have multiple files with the same name.
``` ```
<SharedDriveIDEntity> ::= <SharedDriveIDEntity> ::=
(shareddriveid <DriveFileItem>) | (shareddriveid:<DriveFileItem>) (teamdriveid <DriveFileItem>) | (teamdriveid:<DriveFileItem>)
<SharedDriveNameEntity> ::= <SharedDriveNameEntity> ::=
(shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
<SharedDriveFileNameEntity> ::= <SharedDriveFileNameEntity> ::=
(shareddrivefilename <DriveFileName>) | (shareddrivefilename:<DriveFileName>) (teamdrivefilename <DriveFileName>) | (teamdrivefilename:<DriveFileName>)
``` ```
### Examples ### Examples
``` ```
gam user testuser show fileinfo shareddriveid 1234ABCD shareddrivefilename "Test File" gam user testuser show fileinfo teamdriveid 1234ABCD teamdrivefilename "Test File"
gam user testuser show fileinfo shareddrive "Shared Drive 1" shareddrivefilename "Test File" gam user testuser show fileinfo teamdrive "Shared Drive 1" teamdrivefilename "Test File"
``` ```
## Select Shared Drive file by query ## Select Shared Drive file by query
You can use a query to find a file ID. You perform the query on all Shared Drives or a specific Shared Drive. You can use a query to find a file ID. You perform the query on all Shared Drives or a specific Shared Drive.
@@ -368,7 +367,7 @@ You can use a query to find a file ID. You perform the query on all Shared Drive
See: [Drive Query](https://developers.google.com/drive/api/v3/search-files) See: [Drive Query](https://developers.google.com/drive/api/v3/search-files)
``` ```
<SharedDriveFileQueryEntity> ::= <SharedDriveFileQueryEntity> ::=
(shareddrivequery <QueryDriveFile>) | (shareddrivequery:<QueryDriveFile>) (teamdrivequery <QueryDriveFile>) | (teamdrivequery:<QueryDriveFile>)
<SharedDriveFileQueryShortcut> ::= <SharedDriveFileQueryShortcut> ::=
all_files | all_folders | all_google_files | all_non_google_files | all_items all_files | all_folders | all_google_files | all_non_google_files | all_items
``` ```
@@ -381,32 +380,32 @@ Keyword to query mappings for `<DriveFileQueryShortcut>`:
### Examples ### Examples
``` ```
gam user testuser show fileinfo shareddrivequery "name='Test File'" gam user testuser show fileinfo teamdrivequery "name='Test File'"
gam user testuser show fileinfo shareddriveid 1234ABCD shareddrivequery "name='Test File'" gam user testuser show fileinfo teamdriveid 1234ABCD teamdrivequery "name='Test File'"
gam user testuser show fileinfo shareddrive shareddrive "Shared Drive 1" shareddrivequery "name='Test File'" gam user testuser show fileinfo teamdrive teamdrive "Shared Drive 1" teamdrivequery "name='Test File'"
gam user testuser show fileinfo shareddriveid 1234ABCD all_non_google_files gam user testuser show fileinfo teamdriveid 1234ABCD all_non_google_files
``` ```
## Select root folder of a Shared Drive by ID ## Select root folder of a Shared Drive by ID
The root folder of a Shared Drive is a folder, you select it by giving its unique ID. The root folder of a Shared Drive is a folder, you select it by giving its unique ID.
``` ```
<SharedDriveIDEntity> ::= <SharedDriveIDEntity> ::=
<DriveFileItem> | <DriveFileItem> |
(shareddriveid <DriveFileItem>) | (shareddriveid:<DriveFileItem>) (teamdriveid <DriveFileItem>) | (teamdriveid:<DriveFileItem>)
``` ```
### Examples ### Examples
``` ```
gam user testuser show fileinfo 1234ABCD gam user testuser show fileinfo 1234ABCD
gam user testuser show fileinfo shareddriveid 1234ABCD gam user testuser show fileinfo teamdriveid 1234ABCD
``` ```
## Select root folder of a Shared Drive by name ## Select root folder of a Shared Drive by name
If you have a Shared Drive name, a search must be performed to find the ID that matches the name. If you have a Shared Drive name, a search must be performed to find the ID that matches the name.
``` ```
<SharedDriveNameEntity> ::= <SharedDriveNameEntity> ::=
(shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
``` ```
### Examples ### Examples
``` ```
gam user testuser show fileinfo shareddrive "Shared Drive 1" gam user testuser show fileinfo teamdrive "Shared Drive 1"
``` ```

View File

@@ -27,13 +27,13 @@
(anydrivefilename <DriveFileName>) | (anydrivefilename:<DriveFileName>) (anydrivefilename <DriveFileName>) | (anydrivefilename:<DriveFileName>)
<SharedDriveIDEntity> ::= <SharedDriveIDEntity> ::=
<DriveFileItem> | <DriveFileItem> |
(shareddriveid <DriveFileItem>) | (shareddriveid:<DriveFileItem>) (teamdriveid <DriveFileItem>) | (teamdriveid:<DriveFileItem>)
<SharedDriveName> ::= <String> <SharedDriveName> ::= <String>
<SharedDriveNameEntity> ::= <SharedDriveNameEntity> ::=
(shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveIDEntity> | <SharedDriveIDEntity> |
<SharedDriveNameEntity> <SharedDriveNameEntity>
<SharedDriveFileNameEntity> ::= <SharedDriveFileNameEntity> ::=
(shareddrivefilename <DriveFileName>) | (shareddrivefilename:<DriveFileName>) (teamdrivefilename <DriveFileName>) | (teamdrivefilename:<DriveFileName>)
``` ```

View File

@@ -10,136 +10,6 @@ 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.34.09
Updated `gam <UserTypeEntity> update photo` to delete the user's existing photo
before performing the update as the API update will succeed but not replace a user's existing self-set photo.
### 7.34.08
Rebuild to avoid the following error:
```
requests/__init__.py:113: RequestsDependencyWarning: urllib3 (2.6.3) or chardet (6.0.0.post1)/charset_normalizer (3.4.4) doesn't match a supported version!
```
### 7.34.07
Added the following command to create a guest user.
* See: https://support.google.com/a/answer/16558545
```
gam create guestuser <EmailAddress>
```
Added the following items to `<UserFieldName>`:
* `guestaccountinfo` - Additional guest-related metadata fields
* `isguestuser` - Indicates if the inserted user is a guest
### 7.34.06
Added option `copyfolderpermissions [<Boolean>]` to `gam <UserTypeEntity> copy|move drivefile`.
When `copyfolderpermissions false` is specified, no folder permissions are copied; this simplifies
disabling all folder permission copying.
When not specified or `copyfolderpermissions [true]` is specified, folder permissions are copied based on the following options:
```
copymergewithparentfolderpermissions [<Boolean>]
copymergedtopfolderpermissions [<Boolean>]
copytopfolderpermissions [<Boolean>]
copytopfolderiheritedpermissions [<Boolean>]
copytopfoldernoniheritedpermissions never|always|syncallfolders|syncupdatedfolders
copymergedsubfolderpermissions [<Boolean>]
copysubfolderpermissions [<Boolean>]
copysubfolderinheritedpermissions [<Boolean>]
copysubfoldernoniheritedpermissions never|always|syncallfolders|syncupdatedfolders
```
### 7.34.05
Updated `gam report <ActivityApplictionName>` to perform a reverse chronological sort
on all rows across multiple users and/or event names; this is consistent with the behavior
in the Admin console. Use option `notimesort` to suppress this sort.
### 7.34.04
Updated `gam <UserTypeEntity> create drivefileacl <DriveFileEntity> user <UserItem> role owner` to better
handle the case where the current owner of a file is suspended. Previously, the command was displayed as an error
even though the ownership was changed.
```
gam user currentowner@domain.com add drivefileacl <DriveFileID> user newowner@domain.com role owner
User: currentowner@domain.com, Add 1 Drive File/Folder ACL
User: currentowner@domain.com, Drive File/Folder ID: <DriveFileID>, Permission ID: newowner@domain.com, Add Failed: Sorry, the items were successfully shared but emails could not be sent to newowner@domain.com.
```
Now the command is displayed as a success with a note indicating that the ownership change email was not sent.
```
gam user currentowner@domain.com add drivefileacl <DriveFileID> user newowner@domain.com role owner
User: currentowner@domain.com, Add 1 Drive File/Folder ACL
User: currentowner@domain.com, Drive File/Folder ID: <DriveFileID>, Permission ID: newowner@domain.com, Added: Sorry, the items were successfully shared but emails could not be sent to newowner@domain.com.
New Owner
id: 10834698115409747890
type: user
emailAddress: newowner@domain.com
domain: domain.com
role: owner
permissionDetails:
role: writer
type: file
inherited: True
inheritedFrom: Unknown
role: owner
type: file
inherited: False
deleted: False
pendingOwner: False
```
### 7.34.03
Updated to Python 3.14.3
Updated Cryptography to 46.0.5
Updated `gam course <CourseID> create student|teacher <EmailAddress>` error message when
`<EmailAddress>` is not in a trusted domain to remove suggestion about creating an invitation.
### 7.34.02
Updated GAM to prevent errors like the following:
```
ERROR: Unable to find the server at oauth2.googleapis.com
ERROR: Unable to find the server at gmail.googleapis.com
```
If you experience any unexpected errors, post a message to:
* The GAM Discussion Forum (google-apps-manager@googlegroups.com)
* The GAM Public Chat Room (https://chat.google.com/app/chat/AAAA4BULhWo)
### 7.34.01
Updated `gam create|update adminrole` to handle the following errors:
```
ERROR: 400: invalid - Invalid Role privileges
ERROR: 400: required - Required parameter: [resource.privileges[n].service_id]
```
### 7.34.00
Added variable `csv_output_header_required` to `gam.cfg` that is a comma separated list of `<Strings>`
that are required to be in the list of column headers in the CSV file written by a gam print command.
This will typically be used to specify headers that are required in subsequent commands that process
the CSV file even if the API didn't return any data for those columns.
Updated the following commands to not require the `Directory API - Domains` scope
unless the `internal` or `external` options are used to request the member category.
```
gam info|print groups
gam print|show group-members
gam info|print cigroups
gam print|show cigroup-members
gam <UserTypeEntity> print|show filesharecounts
```
### 7.33.03 ### 7.33.03
Fixed bug in `gam [<UserTypeEntity>] sendemail ... from <EmailAddress> replyto <EmailAddress>` Fixed bug in `gam [<UserTypeEntity>] sendemail ... from <EmailAddress> replyto <EmailAddress>`

View File

@@ -9,30 +9,30 @@ and all necessary authentications.
## Linux and MacOS and Google Cloud Shell ## Linux and MacOS and Google Cloud Shell
In these examples, your Google Super admin is shown as gamteam@domain.com; replace with the In these examples, your Google Super admin is shown as admin@domain.com; replace with the
actual email adddress. actual email adddress.
In these examples, the user home folder is shown as /Users/gamteam; adjust according to your In these examples, the user home folder is shown as /Users/admin; adjust according to your
specific situation; e.g., /home/administrator. specific situation; e.g., /home/administrator.
This example assumes that GAM7 has been installed in /Users/gamteam/bin/gam7. This example assumes that GAM7 has been installed in /Users/admin/bin/gam7.
If you've installed GAM7 in another directory, substitute that value in the directions. If you've installed GAM7 in another directory, substitute that value in the directions.
### Set a configuration directory ### Set a configuration directory
The default GAM configuration directory is /Users/gamteam/.gam; for more flexibility you The default GAM configuration directory is /Users/admin/.gam; for more flexibility you
probably want to select a non-hidden location. This example assumes that the GAM probably want to select a non-hidden location. This example assumes that the GAM
configuration directory will be /Users/gamteam/GAMConfig; If you've chosen another directory, configuration directory will be /Users/admin/GAMConfig; If you've chosen another directory,
substitute that value in the directions. substitute that value in the directions.
Make the directory: Make the directory:
``` ```
gamteam@server:/Users/gamteam$ mkdir -p /Users/gamteam/GAMConfig admin@server:/Users/admin$ mkdir -p /Users/admin/GAMConfig
``` ```
Add the following line: Add the following line:
``` ```
export GAMCFGDIR="/Users/gamteam/GAMConfig" export GAMCFGDIR="/Users/admin/GAMConfig"
``` ```
to one of these files based on your shell: to one of these files based on your shell:
``` ```
@@ -44,34 +44,34 @@ to one of these files based on your shell:
Issue the following command replacing `<Filename>` with the name of the file you edited: Issue the following command replacing `<Filename>` with the name of the file you edited:
``` ```
gamteam@server:/Users/gamteam$ source <Filename> admin@server:/Users/admin$ source <Filename>
``` ```
You need to make sure the GAM configuration directory actually exists. Test that like this: You need to make sure the GAM configuration directory actually exists. Test that like this:
``` ```
gamteam@server:/Users/gamteam$ ls -l $GAMCFGDIR admin@server:/Users/admin$ ls -l $GAMCFGDIR
``` ```
### Set a working directory ### Set a working directory
You should establish a GAM working directory; you will store your GAM related You should establish a GAM working directory; you will store your GAM related
data in this folder and execute GAM commands from this folder. You should not use data in this folder and execute GAM commands from this folder. You should not use
/Users/gamteam/bin/gam7 or /Users/gamteam/GAMConfig for this purpose. /Users/admin/bin/gam7 or /Users/admin/GAMConfig for this purpose.
This example assumes that the GAM working directory will be /Users/gamteam/GAMWork; If you've chosen This example assumes that the GAM working directory will be /Users/admin/GAMWork; If you've chosen
another directory, substitute that value in the directions. another directory, substitute that value in the directions.
Make the directory: Make the directory:
``` ```
gamteam@server:/Users/gamteam$ mkdir -p /Users/gamteam/GAMWork admin@server:/Users/admin$ mkdir -p /Users/admin/GAMWork
``` ```
### Set an alias ### Set an alias
You should set an alias to point to /Users/gamteam/bin/gam7/gam so you can operate from the /Users/gamteam/GAMWork directory. You should set an alias to point to /Users/admin/bin/gam7/gam so you can operate from the /Users/admin/GAMWork directory.
Aliases aren't available in scripts, so you may want to set a symlink instead, see below. Aliases aren't available in scripts, so you may want to set a symlink instead, see below.
Add the following line: Add the following line:
``` ```
alias gam="/Users/gamteam/bin/gam7/gam" alias gam="/Users/admin/bin/gam7/gam"
``` ```
to one of these files based on your shell: to one of these files based on your shell:
``` ```
@@ -84,48 +84,48 @@ to one of these files based on your shell:
Issue the following command replacing `<Filename>` with the name of the file you edited: Issue the following command replacing `<Filename>` with the name of the file you edited:
``` ```
gamteam@server:/Users/gamteam$ source <Filename> admin@server:/Users/admin$ source <Filename>
``` ```
### Set a symlink ### Set a symlink
Set a symlink in `/usr/local/bin` (or some other location on $PATH) to point to GAM. Set a symlink in `/usr/local/bin` (or some other location on $PATH) to point to GAM.
``` ```
gamteam@server:/Users/gamteam$ ln -s "/Users/gamteam/bin/gam7/gam" /usr/local/bin/gam admin@server:/Users/admin$ ln -s "/Users/admin/bin/gam7/gam" /usr/local/bin/gam
``` ```
### Initialize GAM7; this should be the first GAM7 command executed. ### Initialize GAM7; this should be the first GAM7 command executed.
``` ```
gamteam@server:/Users/gamteam$ gam config drive_dir /Users/gamteam/GAMWork verify admin@server:/Users/admin$ gam config drive_dir /Users/admin/GAMWork verify
Created: /Users/gamteam/GAMConfig Created: /Users/admin/GAMConfig
Created: /Users/gamteam/GAMConfig/gamcache Created: /Users/admin/GAMConfig/gamcache
Config File: /Users/gamteam/GAMConfig/gam.cfg, Initialized Config File: /Users/admin/GAMConfig/gam.cfg, Initialized
Section: DEFAULT Section: DEFAULT
... ...
cache_dir = /Users/gamteam/GAMConfig/gamcache cache_dir = /Users/admin/GAMConfig/gamcache
... ...
config_dir = /Users/gamteam/GAMConfig config_dir = /Users/admin/GAMConfig
... ...
drive_dir = /Users/gamteam/GAMWork drive_dir = /Users/admin/GAMWork
... ...
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Verify initialization, this was a successful installation. ### Verify initialization, this was a successful installation.
``` ```
gamteam@server:/Users/gamteam$ ls -l $GAMCFGDIR admin@server:/Users/admin$ ls -l $GAMCFGDIR
total 48 total 48
-rw-r-----+ 1 admin staff 1069 Mar 3 09:23 gam.cfg -rw-r-----+ 1 admin staff 1069 Mar 3 09:23 gam.cfg
drwxr-x---+ 2 admin staff 68 Mar 3 09:23 gamcache drwxr-x---+ 2 admin staff 68 Mar 3 09:23 gamcache
-rw-rw-rw-+ 1 admin staff 0 Mar 3 09:23 oauth2.txt.lock -rw-rw-rw-+ 1 admin staff 0 Mar 3 09:23 oauth2.txt.lock
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Create your project with local browser ### Create your project with local browser
``` ```
gamteam@server:/Users/gamteam$ gam create project admin@server:/Users/admin$ gam create project
WARNING: Config File: /Users/gamteam/GAMConfig/gam.cfg, Item: client_secrets_json, Value: /Users/gamteam/GAMConfig/client_secrets.json, Not Found WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Item: client_secrets_json, Value: /Users/admin/GAMConfig/client_secrets.json, Not Found
WARNING: Config File: /Users/gamteam/GAMConfig/gam.cfg, Item: oauth2service_json, Value: /Users/gamteam/GAMConfig/oauth2service.json, Not Found WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Item: oauth2service_json, Value: /Users/admin/GAMConfig/oauth2service.json, Not Found
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) admin@domain.com
Your browser has been opened to visit: Your browser has been opened to visit:
@@ -167,7 +167,7 @@ Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-p
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Extracting public certificate Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Extracting public certificate
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Done generating private key and public certificate Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Done generating private key and public certificate
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Service Account Key: SVCACCTKEY, Uploaded Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Service Account Key: SVCACCTKEY, Uploaded
Service Account OAuth2 File: /Users/gamteam/GAMConfig/oauth2service.json, Service Account Key: SVCACCTKEY, Updated Service Account OAuth2 File: /Users/admin/GAMConfig/oauth2service.json, Service Account Key: SVCACCTKEY, Updated
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Has rights to rotate own private key Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Has rights to rotate own private key
Please go to: Please go to:
@@ -185,16 +185,16 @@ Enter your Client Secret: CLIENTSECRET
6. Go back to your browser and click OK to close the "OAuth client" popup if it's still open. 6. Go back to your browser and click OK to close the "OAuth client" popup if it's still open.
That's it! Your GAM Project is created and ready to use. That's it! Your GAM Project is created and ready to use.
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Create your project without local browser (Google Cloud Shell for instance) ### Create your project without local browser (Google Cloud Shell for instance)
``` ```
gamteam@server:/Users/gamteam$ gam config no_browser true save admin@server:/Users/admin$ gam config no_browser true save
gamteam@server:/Users/gamteam$ gam create project admin@server:/Users/admin$ gam create project
WARNING: Config File: /Users/gamteam/GAMConfig/gam.cfg, Item: client_secrets_json, Value: /Users/gamteam/GAMConfig/client_secrets.json, Not Found WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Item: client_secrets_json, Value: /Users/admin/GAMConfig/client_secrets.json, Not Found
WARNING: Config File: /Users/gamteam/GAMConfig/gam.cfg, Item: oauth2service_json, Value: /Users/gamteam/GAMConfig/oauth2service.json, Not Found WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Item: oauth2service_json, Value: /Users/admin/GAMConfig/oauth2service.json, Not Found
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) admin@domain.com
Go to the following link in a browser on other computer: Go to the following link in a browser on other computer:
@@ -235,7 +235,7 @@ Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-p
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Extracting public certificate Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Extracting public certificate
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Done generating private key and public certificate Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Done generating private key and public certificate
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Service Account Key: SVCACCTKEY, Uploaded Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Service Account Key: SVCACCTKEY, Uploaded
Service Account OAuth2 File: /Users/gamteam/GAMConfig/oauth2service.json, Service Account Key: SVCACCTKEY, Updated Service Account OAuth2 File: /Users/admin/GAMConfig/oauth2service.json, Service Account Key: SVCACCTKEY, Updated
Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Has rights to rotate own private key Project: gam-project-abc-def-ghi, Service Account: gam-project-abc-def-ghi@gam-project-abc-def-ghi.iam.gserviceaccount.com, Has rights to rotate own private key
Please go to: Please go to:
@@ -253,7 +253,7 @@ Enter your Client Secret: CLIENTSECRET
6. Go back to your browser and click OK to close the "OAuth client" popup if it's still open. 6. Go back to your browser and click OK to close the "OAuth client" popup if it's still open.
That's it! Your GAM Project is created and ready to use. That's it! Your GAM Project is created and ready to use.
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Enable GAM7 client access ### Enable GAM7 client access
@@ -261,7 +261,7 @@ You select a list of scopes, GAM uses a browser to get final authorization from
writes the credentials into the file oauth2.txt. writes the credentials into the file oauth2.txt.
``` ```
gamteam@server:/Users/gamteam$ gam oauth create admin@server:/Users/admin$ gam oauth create
[*] 0) Calendar API (supports readonly) [*] 0) Calendar API (supports readonly)
[*] 1) Chrome Browser Cloud Management API (supports readonly) [*] 1) Chrome Browser Cloud Management API (supports readonly)
@@ -328,7 +328,7 @@ Continue to authorization by entering a 'c'
Please enter 0-50[a|r] or s|u|e|c: c Please enter 0-50[a|r] or s|u|e|c: c
Enter your Google Workspace admin email address? gamteam@domain.com Enter your Google Workspace admin email address? admin@domain.com
Go to the following link in a browser on this computer or on another computer: Go to the following link in a browser on this computer or on another computer:
@@ -340,16 +340,16 @@ click the Allow button, paste "Unable to connect" URL from other computer (only
Enter verification code or paste "Unable to connect" URL from other computer (only URL data up to &scope required): Enter verification code or paste "Unable to connect" URL from other computer (only URL data up to &scope required):
The authentication flow has completed. The authentication flow has completed.
Client OAuth2 File: /Users/gamteam/GAMConfig/oauth2.txt, Created Client OAuth2 File: /Users/admin/GAMConfig/oauth2.txt, Created
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
If clicking on the link in the instructions does not work (i.e. you get a 404 or 400 error message, instead of something about 'unable to connect') the URL in the link is too long. Most likely, you have selected all scopes. Try again with fewer scopes until it works. (there is no harm in repeatedly trying) If clicking on the link in the instructions does not work (i.e. you get a 404 or 400 error message, instead of something about 'unable to connect') the URL in the link is too long. Most likely, you have selected all scopes. Try again with fewer scopes until it works. (there is no harm in repeatedly trying)
### Enable GAM7 service account access. ### Enable GAM7 service account access.
``` ```
gamteam@server:/Users/gamteam$ gam user gamteam@domain.com update serviceaccount admin@server:/Users/admin$ gam user admin@domain.com update serviceaccount
[*] 0) AlertCenter API [*] 0) AlertCenter API
[*] 1) Analytics API - read only [*] 1) Analytics API - read only
[*] 2) Analytics Admin API - read only [*] 2) Analytics Admin API - read only
@@ -413,7 +413,7 @@ Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ FAIL (1/38) https://mail.google.com/ FAIL (1/38)
https://sites.google.com/feeds FAIL (2/38) https://sites.google.com/feeds FAIL (2/38)
https://www.googleapis.com/auth/analytics.readonly FAIL (3/38) https://www.googleapis.com/auth/analytics.readonly FAIL (3/38)
@@ -464,7 +464,7 @@ Click AUTHORIZE
When the box closes you're done When the box closes you're done
After authorizing it may take some time for this test to pass so wait a few moments and then try this command again. After authorizing it may take some time for this test to pass so wait a few moments and then try this command again.
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
The link shown in the error message should take you directly to the authorization screen. The link shown in the error message should take you directly to the authorization screen.
If not, make sure that you are logged in as a domain admin, then re-enter the link. If not, make sure that you are logged in as a domain admin, then re-enter the link.
@@ -474,14 +474,14 @@ If not, make sure that you are logged in as a domain admin, then re-enter the li
Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes
for the authorization to complete. for the authorization to complete.
``` ```
gamteam@server:/Users/gamteam$ gam user gamteam@domain.com check serviceaccount admin@server:/Users/admin$ gam user admin@domain.com check serviceaccount
System time status System time status
Your system time differs from admin.googleapis.com by less than 1 second PASS Your system time differs from admin.googleapis.com by less than 1 second PASS
Service Account Private Key Authentication Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ PASS (1/38) https://mail.google.com/ PASS (1/38)
https://sites.google.com/feeds PASS (2/38) https://sites.google.com/feeds PASS (2/38)
https://www.googleapis.com/auth/analytics.readonly PASS (3/38) https://www.googleapis.com/auth/analytics.readonly PASS (3/38)
@@ -524,14 +524,14 @@ All scopes PASSED!
Service Account Client name: SVCACCTID is fully authorized. Service Account Client name: SVCACCTID is fully authorized.
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Update gam.cfg with some basic values ### Update gam.cfg with some basic values
* `customer_id` - Having this data keeps Gam from having to make extra API calls * `customer_id` - Having this data keeps Gam from having to make extra API calls
* `domain` - This allows you to omit the domain portion of email addresses * `domain` - This allows you to omit the domain portion of email addresses
* `timezone local` - Gam will convert all UTC times to your local timezone * `timezone local` - Gam will convert all UTC times to your local timezone
``` ```
gamteam@server:/Users/gamteam$ gam info domain admin@server:/Users/admin$ gam info domain
Customer ID: C01234567 Customer ID: C01234567
Primary Domain: domain.com Primary Domain: domain.com
Customer Creation Time: 2007-06-06T15:47:55.444Z Customer Creation Time: 2007-06-06T15:47:55.444Z
@@ -539,8 +539,8 @@ Primary Domain Verified: True
Default Language: en Default Language: en
... ...
gamteam@server:/Users/gamteam$ gam config customer_id C01234567 domain domain.com timezone local save verify admin@server:/Users/admin$ gam config customer_id C01234567 domain domain.com timezone local save verify
Config File: /Users/gamteam/GAMConfig/gam.cfg, Saved Config File: /Users/admin/GAMConfig/gam.cfg, Saved
Section: DEFAULT Section: DEFAULT
... ...
customer_id = C01234567 customer_id = C01234567
@@ -550,12 +550,12 @@ Section: DEFAULT
timezone = local timezone = local
... ...
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
## Windows ## Windows
In these examples, your Google Super admin is shown as gamteam@domain.com; replace with the In these examples, your Google Super admin is shown as admin@domain.com; replace with the
actual email adddress. actual email adddress.
This example assumes that GAM7 has been installed in C:\GAM7; if you've installed This example assumes that GAM7 has been installed in C:\GAM7; if you've installed
@@ -645,7 +645,7 @@ C:\>gam create project
WARNING: Config File: C:\GAMConfig\gam.cfg, Item: client_secrets_json, Value: C:\GAMConfig\client_secrets.json, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Item: client_secrets_json, Value: C:\GAMConfig\client_secrets.json, Not Found
WARNING: Config File: C:\GAMConfig\gam.cfg, Item: oauth2service_json, Value: C:\GAMConfig\oauth2service.json, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Item: oauth2service_json, Value: C:\GAMConfig\oauth2service.json, Not Found
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) admin@domain.com
Your browser has been opened to visit: Your browser has been opened to visit:
@@ -714,7 +714,7 @@ C:\>gam create project
WARNING: Config File: C:\GAMConfig\gam.cfg, Item: client_secrets_json, Value: C:\GAMConfig\client_secrets.json, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Item: client_secrets_json, Value: C:\GAMConfig\client_secrets.json, Not Found
WARNING: Config File: C:\GAMConfig\gam.cfg, Item: oauth2service_json, Value: C:\GAMConfig\oauth2service.json, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Item: oauth2service_json, Value: C:\GAMConfig\oauth2service.json, Not Found
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) admin@domain.com
Go to the following link in a browser on other computer: Go to the following link in a browser on other computer:
@@ -848,7 +848,7 @@ Continue to authorization by entering a 'c'
Please enter 0-50[a|r] or s|u|e|c: c Please enter 0-50[a|r] or s|u|e|c: c
Enter your Google Workspace admin email address? gamteam@domain.com Enter your Google Workspace admin email address? admin@domain.com
Go to the following link in a browser on this computer or on another computer: Go to the following link in a browser on this computer or on another computer:
@@ -866,7 +866,7 @@ C:\>
``` ```
### Enable GAM7 service account access. ### Enable GAM7 service account access.
``` ```
C:\>gam user gamteam@domain.com update serviceaccount C:\>gam user admin@domain.com update serviceaccount
[*] 0) AlertCenter API [*] 0) AlertCenter API
[*] 1) Analytics API - read only [*] 1) Analytics API - read only
[*] 2) Analytics Admin API - read only [*] 2) Analytics Admin API - read only
@@ -930,7 +930,7 @@ Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ FAIL (1/38) https://mail.google.com/ FAIL (1/38)
https://sites.google.com/feeds FAIL (2/38) https://sites.google.com/feeds FAIL (2/38)
https://www.googleapis.com/auth/analytics.readonly FAIL (3/38) https://www.googleapis.com/auth/analytics.readonly FAIL (3/38)
@@ -991,14 +991,14 @@ If not, make sure that you are logged in as a domain admin, then re-enter the li
Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes
for the authorization to complete. for the authorization to complete.
``` ```
C:\>gam user gamteam@domain.com check serviceaccount C:\>gam user admin@domain.com check serviceaccount
System time status System time status
Your system time differs from admin.googleapis.com by less than 1 second PASS Your system time differs from admin.googleapis.com by less than 1 second PASS
Service Account Private Key Authentication Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ PASS (1/38) https://mail.google.com/ PASS (1/38)
https://sites.google.com/feeds PASS (2/38) https://sites.google.com/feeds PASS (2/38)
https://www.googleapis.com/auth/analytics.readonly PASS (3/38) https://www.googleapis.com/auth/analytics.readonly PASS (3/38)

View File

@@ -10,30 +10,30 @@ and all necessary authentications.
## Linux and MacOS and Google Cloud Shell ## Linux and MacOS and Google Cloud Shell
In these examples, your Google Super admin is shown as gamteam@domain.com; replace with the In these examples, your Google Super admin is shown as admin@domain.com; replace with the
actual email adddress. actual email adddress.
In these examples, the user home folder is shown as /Users/gamteam; adjust according to your In these examples, the user home folder is shown as /Users/admin; adjust according to your
specific situation; e.g., /home/administrator. specific situation; e.g., /home/administrator.
This example assumes that GAM7 has been installed in /Users/gamteam/bin/gam7. This example assumes that GAM7 has been installed in /Users/admin/bin/gam7.
If you've installed GAM7 in another directory, substitute that value in the directions. If you've installed GAM7 in another directory, substitute that value in the directions.
### Set a configuration directory ### Set a configuration directory
The default GAM configuration directory is /Users/gamteam/.gam; for more flexibility you The default GAM configuration directory is /Users/admin/.gam; for more flexibility you
probably want to select a non-hidden location. This example assumes that the GAM probably want to select a non-hidden location. This example assumes that the GAM
configuration directory will be /Users/gamteam/GAMConfig; If you've chosen another directory, configuration directory will be /Users/admin/GAMConfig; If you've chosen another directory,
substitute that value in the directions. substitute that value in the directions.
Make the directory: Make the directory:
``` ```
gamteam@server:/Users/gamteam$ mkdir -p /Users/gamteam/GAMConfig admin@server:/Users/admin$ mkdir -p /Users/admin/GAMConfig
``` ```
Add the following line: Add the following line:
``` ```
export GAMCFGDIR="/Users/gamteam/GAMConfig" export GAMCFGDIR="/Users/admin/GAMConfig"
``` ```
to one of these files based on your shell: to one of these files based on your shell:
``` ```
@@ -45,34 +45,34 @@ to one of these files based on your shell:
Issue the following command replacing `<Filename>` with the name of the file you edited: Issue the following command replacing `<Filename>` with the name of the file you edited:
``` ```
gamteam@server:/Users/gamteam$ source <Filename> admin@server:/Users/admin$ source <Filename>
``` ```
You need to make sure the GAM configuration directory actually exists. Test that like this: You need to make sure the GAM configuration directory actually exists. Test that like this:
``` ```
gamteam@server:/Users/gamteam$ ls -l $GAMCFGDIR admin@server:/Users/admin$ ls -l $GAMCFGDIR
``` ```
### Set a working directory ### Set a working directory
You should establish a GAM working directory; you will store your GAM related You should establish a GAM working directory; you will store your GAM related
data in this folder and execute GAM commands from this folder. You should not use data in this folder and execute GAM commands from this folder. You should not use
/Users/gamteam/bin/gam7 or /Users/gamteam/GAMConfig for this purpose. /Users/admin/bin/gam7 or /Users/admin/GAMConfig for this purpose.
This example assumes that the GAM working directory will be /Users/gamteam/GAMWork; If you've chosen This example assumes that the GAM working directory will be /Users/admin/GAMWork; If you've chosen
another directory, substitute that value in the directions. another directory, substitute that value in the directions.
Make the directory: Make the directory:
``` ```
gamteam@server:/Users/gamteam$ mkdir -p /Users/gamteam/GAMWork admin@server:/Users/admin$ mkdir -p /Users/admin/GAMWork
``` ```
### Set an alias ### Set an alias
You should set an alias to point to /Users/gamteam/bin/gam7/gam so you can operate from the /Users/gamteam/GAMWork directory. You should set an alias to point to /Users/admin/bin/gam7/gam so you can operate from the /Users/admin/GAMWork directory.
Aliases aren't available in scripts, so you may want to set a symlink instead, see below. Aliases aren't available in scripts, so you may want to set a symlink instead, see below.
Add the following line: Add the following line:
``` ```
alias gam="/Users/gamteam/bin/gam7/gam" alias gam="/Users/admin/bin/gam7/gam"
``` ```
to one of these files based on your shell: to one of these files based on your shell:
``` ```
@@ -85,62 +85,62 @@ to one of these files based on your shell:
If you already have an alias for legacy GAM but are no longer going to run it, delete these lines: If you already have an alias for legacy GAM but are no longer going to run it, delete these lines:
``` ```
function gam() { "/Users/gamteam/bin/gam/gam" "$@" ; }" function gam() { "/Users/admin/bin/gam/gam" "$@" ; }"
alias gam="/Users/gamteam/bin/gam/gam" alias gam="/Users/admin/bin/gam/gam"
``` ```
If you already have an alias for legacy GAM and want to run it and GAM7, give your old alias a different name: If you already have an alias for legacy GAM and want to run it and GAM7, give your old alias a different name:
``` ```
function gamstd() { "/Users/gamteam/bin/gam/gam" "$@" ; }" function gamstd() { "/Users/admin/bin/gam/gam" "$@" ; }"
alias gamstd="/Users/gamteam/bin/gam/gam" alias gamstd="/Users/admin/bin/gam/gam"
``` ```
Issue the following command replacing `<Filename>` with the name of the file you edited: Issue the following command replacing `<Filename>` with the name of the file you edited:
``` ```
gamteam@server:/Users/gamteam$ source <Filename> admin@server:/Users/admin$ source <Filename>
``` ```
### Set a symlink ### Set a symlink
Set a symlink in `/usr/local/bin` (or some other location on $PATH) to point to GAM. Set a symlink in `/usr/local/bin` (or some other location on $PATH) to point to GAM.
``` ```
gamteam@server:/Users/gamteam$ ln -s "/Users/gamteam/bin/gam7/gam" /usr/local/bin/gam admin@server:/Users/admin$ ln -s "/Users/admin/bin/gam7/gam" /usr/local/bin/gam
``` ```
Set environment variable OLDGAMPATH to point to the existing Gam directory; /Users/gamteam/bin/gam will be used in this example. Set environment variable OLDGAMPATH to point to the existing Gam directory; /Users/admin/bin/gam will be used in this example.
If your existing Gam is in another directory, substitute that value in the directions. If your existing Gam is in another directory, substitute that value in the directions.
``` ```
gamteam@server:/Users/gamteam$ export OLDGAMPATH=/Users/gamteam/bin/gam admin@server:/Users/admin$ export OLDGAMPATH=/Users/admin/bin/gam
``` ```
Verify that OLDGAMPATH points to the correct location. Verify that OLDGAMPATH points to the correct location.
``` ```
gamteam@server:/Users/gamteam$ ls -l $OLDGAMPATH/*.json admin@server:/Users/admin$ ls -l $OLDGAMPATH/*.json
-rw-r-----@ 1 admin staff 553 Feb 26 10:39 /Users/gamteam/bin/gam/client_secrets.json -rw-r-----@ 1 admin staff 553 Feb 26 10:39 /Users/admin/bin/gam/client_secrets.json
-rw-r-----@ 1 admin staff 2377 Feb 26 10:39 /Users/gamteam/bin/gam/oauth2service.json -rw-r-----@ 1 admin staff 2377 Feb 26 10:39 /Users/admin/bin/gam/oauth2service.json
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Initialize GAM7; this should be the first GAM7 command executed. ### Initialize GAM7; this should be the first GAM7 command executed.
``` ```
gamteam@server:/Users/gamteam$ gam config drive_dir /Users/gamteam/GAMWork verify admin@server:/Users/admin$ gam config drive_dir /Users/admin/GAMWork verify
Created: /Users/gamteam/GAMConfig Created: /Users/admin/GAMConfig
Created: /Users/gamteam/GAMConfig/gamcache Created: /Users/admin/GAMConfig/gamcache
Copied: /Users/gamteam/bin/gam/oauth2service.json, To: /Users/gamteam/GAMConfig/oauth2service.json Copied: /Users/admin/bin/gam/oauth2service.json, To: /Users/admin/GAMConfig/oauth2service.json
Copied: /Users/gamteam/bin/gam/oauth2.txt, To: /Users/gamteam/GAMConfig/oauth2.txt Copied: /Users/admin/bin/gam/oauth2.txt, To: /Users/admin/GAMConfig/oauth2.txt
Copied: /Users/gamteam/bin/gam/client_secrets.json, To: /Users/gamteam/GAMConfig/client_secrets.json Copied: /Users/admin/bin/gam/client_secrets.json, To: /Users/admin/GAMConfig/client_secrets.json
Config File: /Users/gamteam/GAMConfig/gam.cfg, Initialized Config File: /Users/admin/GAMConfig/gam.cfg, Initialized
Section: DEFAULT Section: DEFAULT
... ...
cache_dir = /Users/gamteam/GAMConfig/gamcache cache_dir = /Users/admin/GAMConfig/gamcache
... ...
config_dir = /Users/gamteam/GAMConfig config_dir = /Users/admin/GAMConfig
... ...
drive_dir = /Users/gamteam/GAMWork drive_dir = /Users/admin/GAMWork
... ...
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Verify initialization, this was a successful installation. ### Verify initialization, this was a successful installation.
``` ```
gamteam@server:/Users/gamteam$ ls -l $GAMCFGDIR admin@server:/Users/admin$ ls -l $GAMCFGDIR
total 48 total 48
-rw-r-----+ 1 admin staff 553 Mar 3 09:23 client_secrets.json -rw-r-----+ 1 admin staff 553 Mar 3 09:23 client_secrets.json
-rw-r-----+ 1 admin staff 1069 Mar 3 09:23 gam.cfg -rw-r-----+ 1 admin staff 1069 Mar 3 09:23 gam.cfg
@@ -149,21 +149,21 @@ drwxr-x---+ 2 admin staff 68 Mar 3 09:23 gamcache
-rw-r-----+ 1 admin staff 5104 Mar 3 09:23 oauth2.txt -rw-r-----+ 1 admin staff 5104 Mar 3 09:23 oauth2.txt
-rw-rw-rw-+ 1 admin staff 0 Mar 3 09:23 oauth2.txt.lock -rw-rw-rw-+ 1 admin staff 0 Mar 3 09:23 oauth2.txt.lock
-rw-r-----+ 1 admin staff 2377 Mar 3 09:23 oauth2service.json -rw-r-----+ 1 admin staff 2377 Mar 3 09:23 oauth2service.json
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
If the verification looks like this, then you'll have to copy client_secrets.json and oauth2service.json manually. If the verification looks like this, then you'll have to copy client_secrets.json and oauth2service.json manually.
``` ```
gamteam@server:/Users/gamteam$ ls -l $GAMCFGDIR admin@server:/Users/admin$ ls -l $GAMCFGDIR
total 40 total 40
-rw-r-----+ 1 admin admin 1427 Nov 1 11:38 gam.cfg -rw-r-----+ 1 admin admin 1427 Nov 1 11:38 gam.cfg
drwxr-x---+ 16 admin admin 544 Nov 2 07:25 gamcache drwxr-x---+ 16 admin admin 544 Nov 2 07:25 gamcache
-rw-r--r--+ 1 admin admin 10 Nov 2 15:31 lastupdatecheck.txt -rw-r--r--+ 1 admin admin 10 Nov 2 15:31 lastupdatecheck.txt
-rw-rw-rw-+ 1 admin admin 0 Sep 19 17:28 oauth2.txt.lock -rw-rw-rw-+ 1 admin admin 0 Sep 19 17:28 oauth2.txt.lock
gamteam@server:/Users/gamteam$ cp -p $OLDGAMPATH/client_secrets.json $GAMCFGDIR/ admin@server:/Users/admin$ cp -p $OLDGAMPATH/client_secrets.json $GAMCFGDIR/
gamteam@server:/Users/gamteam$ cp -p $OLDGAMPATH/oauth2service.json $GAMCFGDIR/ admin@server:/Users/admin$ cp -p $OLDGAMPATH/oauth2service.json $GAMCFGDIR/
gamteam@server:/Users/gamteam$ cp -p $OLDGAMPATH/oauth2.txt $GAMCFGDIR/ admin@server:/Users/admin$ cp -p $OLDGAMPATH/oauth2.txt $GAMCFGDIR/
gamteam@server:/Users/gamteam$ ls -l $GAMCFGDIR admin@server:/Users/admin$ ls -l $GAMCFGDIR
total 40 total 40
-rw-r-----+ 1 admin staff 553 Mar 3 09:23 client_secrets.json -rw-r-----+ 1 admin staff 553 Mar 3 09:23 client_secrets.json
-rw-r-----+ 1 admin staff 1069 Mar 3 09:23 gam.cfg -rw-r-----+ 1 admin staff 1069 Mar 3 09:23 gam.cfg
@@ -175,9 +175,9 @@ drwxr-x---+ 2 admin staff 68 Mar 3 09:23 gamcache
``` ```
### Update your project with local browser to include the additional APIs that GAM7 uses. ### Update your project with local browser to include the additional APIs that GAM7 uses.
``` ```
gamteam@server:/Users/gamteam$ gam update project admin@server:/Users/admin$ gam update project
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? admin@domain.com
Your browser has been opened to visit: Your browser has been opened to visit:
@@ -205,14 +205,14 @@ Enable 3 APIs
API: groupsmigration.googleapis.com, Enabled (2/3) API: groupsmigration.googleapis.com, Enabled (2/3)
API: sheets.googleapis.com, Enabled (3/3) API: sheets.googleapis.com, Enabled (3/3)
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Update your project without local browser (Google Cloud Shell for instance) to include the additional APIs that GAM7 uses ### Update your project without local browser (Google Cloud Shell for instance) to include the additional APIs that GAM7 uses
``` ```
gamteam@server:/Users/gamteam$ gam config no_browser true save admin@server:/Users/admin$ gam config no_browser true save
gamteam@server:/Users/gamteam$ gam update project admin@server:/Users/admin$ gam update project
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? admin@domain.com
Go to the following link in a browser on other computer: Go to the following link in a browser on other computer:
@@ -239,7 +239,7 @@ Enable 3 APIs
API: groupsmigration.googleapis.com, Enabled (2/3) API: groupsmigration.googleapis.com, Enabled (2/3)
API: sheets.googleapis.com, Enabled (3/3) API: sheets.googleapis.com, Enabled (3/3)
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Enable GAM7 client access ### Enable GAM7 client access
@@ -249,17 +249,17 @@ You select a list of scopes, GAM uses a browser to get final authorization from
writes the credentials into the file oauth2.txt. writes the credentials into the file oauth2.txt.
``` ```
gamteam@server:/Users/gamteam$ rm -f /Users/gamteam/GAMConfig/oauth2.txt admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt
gamteam@server:/Users/gamteam$ gam version admin@server:/Users/admin$ gam version
WARNING: Config File: /Users/gamteam/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/gamteam/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.34.09 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.33.03 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.2 64-bit final
macOS Tahoe 26.3 arm64 macOS Tahoe 26.2 x86_64
Path: /Users/gamteam/bin/gam7 Path: /Users/admin/bin/gam7
Config File: /Users/gamteam/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
gamteam@server:/Users/gamteam$ gam oauth create admin@server:/Users/admin$ gam oauth create
[*] 0) Calendar API (supports readonly) [*] 0) Calendar API (supports readonly)
[*] 1) Chrome Browser Cloud Management API (supports readonly) [*] 1) Chrome Browser Cloud Management API (supports readonly)
@@ -326,7 +326,7 @@ Continue to authorization by entering a 'c'
Please enter 0-50[a|r] or s|u|e|c: c Please enter 0-50[a|r] or s|u|e|c: c
Enter your Google Workspace admin email address? gamteam@domain.com Enter your Google Workspace admin email address? admin@domain.com
Go to the following link in a browser on this computer or on another computer: Go to the following link in a browser on this computer or on another computer:
@@ -338,13 +338,13 @@ click the Allow button, paste "Unable to connect" URL from other computer (only
Enter verification code or paste "Unable to connect" URL from other computer (only URL data up to &scope required): Enter verification code or paste "Unable to connect" URL from other computer (only URL data up to &scope required):
The authentication flow has completed. The authentication flow has completed.
Client OAuth2 File: /Users/gamteam/GAMConfig/oauth2.txt, Created Client OAuth2 File: /Users/admin/GAMConfig/oauth2.txt, Created
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Enable GAM7 service account access. ### Enable GAM7 service account access.
``` ```
gamteam@server:/Users/gamteam$ gam user gamteam@domain.com update serviceaccount admin@server:/Users/admin$ gam user admin@domain.com update serviceaccount
[*] 0) AlertCenter API [*] 0) AlertCenter API
[*] 1) Analytics API - read only [*] 1) Analytics API - read only
[*] 2) Analytics Admin API - read only [*] 2) Analytics Admin API - read only
@@ -408,7 +408,7 @@ Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ PASS (1/38) https://mail.google.com/ PASS (1/38)
https://sites.google.com/feeds FAIL (2/38) https://sites.google.com/feeds FAIL (2/38)
https://www.googleapis.com/auth/analytics.readonly FAIL (3/38) https://www.googleapis.com/auth/analytics.readonly FAIL (3/38)
@@ -459,7 +459,7 @@ Click AUTHORIZE
When the box closes you're done When the box closes you're done
After authorizing it may take some time for this test to pass so wait a few moments and then try this command again. After authorizing it may take some time for this test to pass so wait a few moments and then try this command again.
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
The link shown in the error message should take you directly to the authorization screen. The link shown in the error message should take you directly to the authorization screen.
If not, make sure that you are logged in as a domain admin, then re-enter the link. If not, make sure that you are logged in as a domain admin, then re-enter the link.
@@ -469,7 +469,7 @@ If not, make sure that you are logged in as a domain admin, then re-enter the li
Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes
for the authorization to complete. for the authorization to complete.
``` ```
gamteam@server:/Users/gamteam$ gam user gamteam@domain.com check serviceaccount admin@server:/Users/admin$ gam user admin@domain.com check serviceaccount
System time status System time status
Your system time differs from admin.googleapis.com by less than 1 second PASS Your system time differs from admin.googleapis.com by less than 1 second PASS
@@ -477,7 +477,7 @@ Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ PASS (1/38) https://mail.google.com/ PASS (1/38)
https://sites.google.com/feeds PASS (2/38) https://sites.google.com/feeds PASS (2/38)
https://www.googleapis.com/auth/analytics.readonly PASS (3/38) https://www.googleapis.com/auth/analytics.readonly PASS (3/38)
@@ -519,14 +519,14 @@ Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38
All scopes PASSED! All scopes PASSED!
Service Account Client name: SVCACCTID is fully authorized. Service Account Client name: SVCACCTID is fully authorized.
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
### Update gam.cfg with some basic values ### Update gam.cfg with some basic values
* `customer_id` - Having this data keeps Gam from having to make extra API calls * `customer_id` - Having this data keeps Gam from having to make extra API calls
* `domain` - This allows you to omit the domain portion of email addresses * `domain` - This allows you to omit the domain portion of email addresses
* `timezone local` - Gam will convert all UTC times to your local timezone * `timezone local` - Gam will convert all UTC times to your local timezone
``` ```
gamteam@server:/Users/gamteam$ gam info domain admin@server:/Users/admin$ gam info domain
Customer ID: C01234567 Customer ID: C01234567
Primary Domain: domain.com Primary Domain: domain.com
Customer Creation Time: 2007-06-06T15:47:55.444Z Customer Creation Time: 2007-06-06T15:47:55.444Z
@@ -534,8 +534,8 @@ Primary Domain Verified: True
Default Language: en Default Language: en
... ...
gamteam@server:/Users/gamteam$ gam config customer_id C01234567 domain domain.com timezone local save verify admin@server:/Users/admin$ gam config customer_id C01234567 domain domain.com timezone local save verify
Config File: /Users/gamteam/GAMConfig/gam.cfg, Saved Config File: /Users/admin/GAMConfig/gam.cfg, Saved
Section: DEFAULT Section: DEFAULT
activity_max_results = 100 activity_max_results = 100
admin_email = '' admin_email = ''
@@ -546,18 +546,18 @@ Section: DEFAULT
bail_on_internal_error_tries = 2 bail_on_internal_error_tries = 2
batch_size = 50 batch_size = 50
cacerts_pem = '' cacerts_pem = ''
cache_dir = /Users/gamteam/GAMConfig/gamcache cache_dir = /Users/admin/GAMConfig/gamcache
cache_discovery_only = true cache_discovery_only = true
channel_customer_id = '' channel_customer_id = ''
charset = utf-8 charset = utf-8
chat_max_results = 100 chat_max_results = 100
classroom_max_results = 0 classroom_max_results = 0
client_secrets_json = client_secrets.json ; /Users/gamteam/GAMConfig/client_secrets.json client_secrets_json = client_secrets.json ; /Users/admin/GAMConfig/client_secrets.json
clock_skew_in_seconds = 10 clock_skew_in_seconds = 10
cmdlog = '' cmdlog = ''
cmdlog_max_backups = 5 cmdlog_max_backups = 5
cmdlog_max_kilo_bytes = 1000 cmdlog_max_kilo_bytes = 1000
config_dir = /Users/gamteam/GAMConfig config_dir = /Users/admin/GAMConfig
contact_max_results = 100 contact_max_results = 100
csv_input_column_delimiter = , csv_input_column_delimiter = ,
csv_input_no_escape_char = true csv_input_no_escape_char = true
@@ -574,7 +574,6 @@ Section: DEFAULT
csv_output_header_filter = '' csv_output_header_filter = ''
csv_output_header_force = '' csv_output_header_force = ''
csv_output_header_order = '' csv_output_header_order = ''
csv_output_header_required = ''
csv_output_line_terminator = lf csv_output_line_terminator = lf
csv_output_no_escape_char = false csv_output_no_escape_char = false
csv_output_quote_char = '"' csv_output_quote_char = '"'
@@ -594,7 +593,7 @@ Section: DEFAULT
developer_preview_apis = '' developer_preview_apis = ''
device_max_results = 200 device_max_results = 200
domain = domain.com domain = domain.com
drive_dir = /Users/gamteam/GAMWork drive_dir = /Users/admin/GAMWork
drive_max_results = 1000 drive_max_results = 1000
email_batch_size = 50 email_batch_size = 50
enable_dasa = false enable_dasa = false
@@ -622,8 +621,8 @@ Section: DEFAULT
no_verify_ssl = false no_verify_ssl = false
num_tbatch_threads = 2 num_tbatch_threads = 2
num_threads = 5 num_threads = 5
oauth2_txt = oauth2.txt ; /Users/gamteam/GAMConfig/oauth2.txt oauth2_txt = oauth2.txt ; /Users/admin/GAMConfig/oauth2.txt
oauth2service_json = oauth2service.json ; /Users/gamteam/GAMConfig/oauth2service.json oauth2service_json = oauth2service.json ; /Users/admin/GAMConfig/oauth2service.json
output_dateformat = '' output_dateformat = ''
output_timeformat = '' output_timeformat = ''
people_max_results = 100 people_max_results = 100
@@ -674,12 +673,12 @@ Section: DEFAULT
user_max_results = 500 user_max_results = 500
user_service_account_access_only = false user_service_account_access_only = false
gamteam@server:/Users/gamteam$ admin@server:/Users/admin$
``` ```
## Windows ## Windows
In these examples, your Google Super admin is shown as gamteam@domain.com; replace with the In these examples, your Google Super admin is shown as admin@domain.com; replace with the
actual email adddress. actual email adddress.
This example assumes that GAM7 has been installed in C:\GAM7; if you've installed This example assumes that GAM7 has been installed in C:\GAM7; if you've installed
@@ -798,7 +797,6 @@ Section: DEFAULT
csv_output_header_filter = '' csv_output_header_filter = ''
csv_output_header_force = '' csv_output_header_force = ''
csv_output_header_order = '' csv_output_header_order = ''
csv_output_header_required = ''
csv_output_line_terminator = lf csv_output_line_terminator = lf
csv_output_no_escape_char = false csv_output_no_escape_char = false
csv_output_quote_char = '"' csv_output_quote_char = '"'
@@ -965,7 +963,7 @@ C:\>dir %GAMCFGDIR%
``` ```
C:\>gam update project C:\>gam update project
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? admin@domain.com
Your browser has been opened to visit: Your browser has been opened to visit:
@@ -997,7 +995,7 @@ C:\>
C:\>gam config no_browser true save C:\>gam config no_browser true save
C:\>gam update project C:\>gam update project
Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? gamteam@domain.com Enter your Google Workspace admin or GCP project manager email address authorized to manage project(s) gam-project-abc-123-xyz? admin@domain.com
Go to the following link in a browser on other computer: Go to the following link in a browser on other computer:
@@ -1036,9 +1034,9 @@ 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.34.09 - https://github.com/GAM-team/GAM - pythonsource GAM 7.33.03 - https://github.com/GAM-team/GAM - pythonsource
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.2 64-bit final
Windows 11 10.0.26200 AMD64 Windows 11 10.0.26200 AMD64
Path: C:\GAM7 Path: C:\GAM7
Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
@@ -1110,7 +1108,7 @@ Continue to authorization by entering a 'c'
Please enter 0-50[a|r] or s|u|e|c: c Please enter 0-50[a|r] or s|u|e|c: c
Enter your Google Workspace admin email address? gamteam@domain.com Enter your Google Workspace admin email address? admin@domain.com
Go to the following link in a browser on this computer or on another computer: Go to the following link in a browser on this computer or on another computer:
@@ -1129,7 +1127,7 @@ C:\>
### Enable GAM7 service account access. ### Enable GAM7 service account access.
``` ```
C:\>gam user gamteam@domain.com update serviceaccount C:\>gam user admin@domain.com update serviceaccount
[*] 0) AlertCenter API [*] 0) AlertCenter API
[*] 1) Analytics API - read only [*] 1) Analytics API - read only
[*] 2) Analytics Admin API - read only [*] 2) Analytics Admin API - read only
@@ -1193,7 +1191,7 @@ Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ PASS (1/38) https://mail.google.com/ PASS (1/38)
https://sites.google.com/feeds FAIL (2/38) https://sites.google.com/feeds FAIL (2/38)
https://www.googleapis.com/auth/analytics.readonly FAIL (3/38) https://www.googleapis.com/auth/analytics.readonly FAIL (3/38)
@@ -1254,14 +1252,14 @@ If not, make sure that you are logged in as a domain admin, then re-enter the li
Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes Wait a moment and then perform the following command; it it still fails, wait a bit longer, it can sometimes take serveral minutes
for the authorization to complete. for the authorization to complete.
``` ```
C:\>gam user gamteam@domain.com check serviceaccount C:\>gam user admin@domain.com check serviceaccount
System time status System time status
Your system time differs from admin.googleapis.com by less than 1 second PASS Your system time differs from admin.googleapis.com by less than 1 second PASS
Service Account Private Key Authentication Service Account Private Key Authentication
Authentication PASS Authentication PASS
Service Account Private Key age; Google recommends rotating keys on a routine basis Service Account Private Key age; Google recommends rotating keys on a routine basis
Service Account Private Key age: 1 day WARN Service Account Private Key age: 1 day WARN
Domain-wide Delegation authentication:, User: gamteam@domain.com, Scopes: 38 Domain-wide Delegation authentication:, User: admin@domain.com, Scopes: 38
https://mail.google.com/ PASS (1/38) https://mail.google.com/ PASS (1/38)
https://sites.google.com/feeds PASS (2/38) https://sites.google.com/feeds PASS (2/38)
https://www.googleapis.com/auth/analytics.readonly PASS (3/38) https://www.googleapis.com/auth/analytics.readonly PASS (3/38)
@@ -1359,7 +1357,6 @@ Section: DEFAULT
csv_output_header_filter = '' csv_output_header_filter = ''
csv_output_header_force = '' csv_output_header_force = ''
csv_output_header_order = '' csv_output_header_order = ''
csv_output_header_required = ''
csv_output_line_terminator = lf csv_output_line_terminator = lf
csv_output_no_escape_char = false csv_output_no_escape_char = false
csv_output_quote_char = '"' csv_output_quote_char = '"'

View File

@@ -56,7 +56,6 @@ The only `<VariableNames>` recognized in this `<Section>` are:
* `csv_output_header_drop_filter` * `csv_output_header_drop_filter`
* `csv_output_header_force` * `csv_output_header_force`
* `csv_output_header_order` * `csv_output_header_order`
* `csv_output_header_required`
* `csv_output_row_filter` * `csv_output_row_filter`
* `csv_output_row_filter_mode` * `csv_output_row_filter_mode`
* `csv_output_row_drop_filter` * `csv_output_row_drop_filter`

View File

@@ -1,7 +1,6 @@
# Organizational Units # Organizational Units
- [API documentation](#api-documentation) - [API documentation](#api-documentation)
- [Definitions](#definitions) - [Definitions](#definitions)
- [Special character issues](#special-character-issues)
- [Special quoting](#special-quoting) - [Special quoting](#special-quoting)
- [Manage organizational units](#manage-organizational-units) - [Manage organizational units](#manage-organizational-units)
- [Add users to an organizational unit](#add-users-to-an-organizational-unit) - [Add users to an organizational unit](#add-users-to-an-organizational-unit)
@@ -51,15 +50,6 @@ For `<UserTypeEntity>`, see: [Collections of Users](Collections-Of-Users)
For `<CrOSTypeEntity>`, see: [Collections of ChromeOS Devices](Collections-of-ChromeOS-Devices) For `<CrOSTypeEntity>`, see: [Collections of ChromeOS Devices](Collections-of-ChromeOS-Devices)
## Special character issues
If an organizational unit name contains a `#` or a `+`, these commands will not work due to a bug
that Google does not plan to fix.
```
gam update org|ou <OrgUnitPath>
gam delete org|ou <OrgUnitPath>
gam info org|ou <OrgUnitPath>
```
## Special quoting ## Special quoting
You specify a single organizational unit with `org <OrgUnitPath>` and a list of organizationsl units with `orgs <OrgUnitList>`. You specify a single organizational unit with `org <OrgUnitPath>` and a list of organizationsl units with `orgs <OrgUnitList>`.
As organizational unit paths can contain spaces, some care must be used when entering `<OrgUnitPath>` and `<OrgUnitList>`. As organizational unit paths can contain spaces, some care must be used when entering `<OrgUnitPath>` and `<OrgUnitList>`.

View File

@@ -14,17 +14,17 @@
## API documentation ## API documentation
* [Activity Data Sources](https://support.google.com/a/answer/11482175) * [Activity Data Sources](https://support.google.com/a/answer/11482175)
Changes starting 2025-10-29.
* [Reports API - Admin log event changes](https://support.google.com/a/answer/16601511)
Changes starting 2025-12-20 Changes starting 2025-12-20
* [Reports API - Admin log enhancements](https://workspaceupdates.googleblog.com/2025/12/google-workspace-audit-log-api.html) * [Reports API - Admin log enhancements](https://workspaceupdates.googleblog.com/2025/12/google-workspace-audit-log-api.html)
Changes starting 2026-02-17. These pages show event/parameter names; scroll down in the left column to: Reports.
* [Reports API - Admin log event changes](https://support.google.com/a/answer/16601511)
These pages show event/parameter names: * [Reports API - Activities](https://developers.google.com/admin-sdk/reports/v1/reference/activities)
* [Reports API - Admin Activities](https://developers.google.com/workspace/admin/reports/v1/appendix/activity/admin-event-names) * [Reports API - Customer Usage](https://developers.google.com/admin-sdk/reports/v1/reference/customerUsageReports)
* [Reports API - Activities](https://developers.google.com/workspace/admin/reports/v1/appendix/activity/access-transparency) * [Reports API - User Usage](https://developers.google.com/admin-sdk/reports/v1/reference/userUsageReport)
* [Reports API - Customer Usage](https://developers.google.com/workspace/admin/reports/v1/appendix/usage/customer)
* [Reports API - User Usage](https://developers.google.com/workspace/admin/reports/v1/appendix/usage/user)
## Definitions ## Definitions
``` ```
@@ -99,7 +99,6 @@ gam report <ActivityApplicationName> [todrive <ToDriveAttribute>*]
[event|events <EventNameList>] [ip <String>] [event|events <EventNameList>] [ip <String>]
[gmaileventtypes <NumberRangeList>] [gmaileventtypes <NumberRangeList>]
[groupidfilter <String>] [resourcedetailsfilter <String>] [groupidfilter <String>] [resourcedetailsfilter <String>]
[notimesort]
[maxactivities <Number>] [maxevents <Number>] [maxresults <Number>] [maxactivities <Number>] [maxevents <Number>] [maxresults <Number>]
[countsonly [bydate|summary] [eventrowfilter]] [countsonly [bydate|summary] [eventrowfilter]]
(addcsvdata <FieldName> <String>)* [shownoactivities] (addcsvdata <FieldName> <String>)* [shownoactivities]
@@ -177,9 +176,6 @@ show the most recent activity/event; this can be useful when reporting drive act
Add additional columns of data from the command line to the output. Add additional columns of data from the command line to the output.
* `addcsvdata <FieldName> <String>` * `addcsvdata <FieldName> <String>`
By default, a reverse chronological sort is performed on all rows across multiple users and/or event names;
this is consistent with the behavior in the Admin console. Use option `notimesort` to suppress this sort.
Display a row with a key value of `NoActivities` when there are no activities to report. Display a row with a key value of `NoActivities` when there are no activities to report.
* `shownoactivities` * `shownoactivities`

View File

@@ -171,7 +171,7 @@
withlink withlink
<DrivePermissionsFieldNameList> ::= "<DrivePermissionsFieldName>(,<DrivePermissionsFieldName>)*" <DrivePermissionsFieldNameList> ::= "<DrivePermissionsFieldName>(,<DrivePermissionsFieldName>)*"
<QuerySharedDrive> ::= <String> See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives <QueryTeamDrive> ::= <String> See: https://developers.google.com/drive/api/v3/search-parameters
<SharedDriveACLRole> ::= <SharedDriveACLRole> ::=
manager|organizer|owner| manager|organizer|owner|
contentmanager|fileorganizer| contentmanager|fileorganizer|
@@ -183,8 +183,8 @@
<SharedDriveName> ::= <String> <SharedDriveName> ::= <String>
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveID>| <SharedDriveID>|
(shareddriveid <SharedDriveID>)|(shareddriveid:<SharedDriveID>)| (teamdriveid <SharedDriveID>)|(teamdriveid:<SharedDriveID>)|
(shareddrive <SharedDriveName>)|(shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>)|(teamdrive:<SharedDriveName>)
<SharedDriveFieldName> ::= <SharedDriveFieldName> ::=
backgroundimagefile| backgroundimagefile|
@@ -199,11 +199,11 @@
<SharedDriveFieldNameList> ::= "<SharedDriveFieldName>(,<SharedDriveFieldName>)*" <SharedDriveFieldNameList> ::= "<SharedDriveFieldName>(,<SharedDriveFieldName>)*"
<SharedDriveIDEntity> ::= <SharedDriveIDEntity> ::=
<DriveFileItem>|(shareddriveid <DriveFileItem>)|(shareddriveid:<DriveFileItem>) <DriveFileItem>|(teamdriveid <DriveFileItem>)|(teamdriveid:<DriveFileItem>)
<SharedDriveNameEntity> ::= <SharedDriveNameEntity> ::=
(shareddrive <SharedDriveName>)|(shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>)|(teamdrive:<SharedDriveName>)
<SharedDriveAdminQueryEntity> ::= <SharedDriveAdminQueryEntity> ::=
(shareddriveadminquery <QuerySharedDrive>)|(shareddriveadminquery:<QuerySharedDrive>) (teamdriveadminquery <QueryTeamDrive>)|(teamdriveadminquery:<QueryTeamDrive>)
<SharedDriveEntityAdmin> ::= <SharedDriveEntityAdmin> ::=
<SharedDriveIDEntity> | <SharedDriveIDEntity> |
@@ -327,11 +327,11 @@ When either of these options is chosen, no infomation about Shared Drive restric
To retrieve the Shared Drive ID with `returnidonly`: To retrieve the Shared Drive ID with `returnidonly`:
``` ```
Linux/MacOS Linux/MacOS
shareddriveId=$(gam create shareddrive ... returnidonly) teamDriveId=$(gam create shareddrive ... returnidonly)
Windows PowerShell Windows PowerShell
$shareddriveId = & gam create shareddrive ... returnidonly $teamDriveId = & gam create shareddrive ... returnidonly
Windows Command Prompt Windows Command Prompt
for /f "delims=" %a in ('gam create shareddrive ... returnidonly') do set shareddriveId=%a for /f "delims=" %a in ('gam create shareddrive ... returnidonly') do set teamDriveId=%a
``` ```
## Bulk Create Shared Drives ## Bulk Create Shared Drives
@@ -422,14 +422,14 @@ By default, Gam displays the information as an indented list of keys and values.
* `formatjson` - Display the fields in JSON format. * `formatjson` - Display the fields in JSON format.
``` ```
gam [<UserTypeEntity>] show shareddrives gam [<UserTypeEntity>] show shareddrives
[adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>] [adminaccess|asadmin] [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
[fields <SharedDriveFieldNameList>] [fields <SharedDriveFieldNameList>]
[showwebviewlink text|hyperlink] [showwebviewlink text|hyperlink]
[formatjson] [formatjson]
``` ```
By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QuerySharedDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern. * `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 * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
@@ -441,14 +441,14 @@ By default, Gam displays the information as an indented list of keys and values.
* `formatjson` - Display the fields in JSON format. * `formatjson` - Display the fields in JSON format.
``` ```
gam [<UserTypeEntity>] print shareddrives [todrive <ToDriveAttribute>*] gam [<UserTypeEntity>] print shareddrives [todrive <ToDriveAttribute>*]
[adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>] [adminaccess|asadmin] [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
[fields <SharedDriveFieldNameList>] [fields <SharedDriveFieldNameList>]
[showwebviewlink text|hyperlink] [showwebviewlink text|hyperlink]
[formatjson [quotechar <Character>]] [formatjson [quotechar <Character>]]
``` ```
By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QuerySharedDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern. * `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 * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
@@ -498,7 +498,7 @@ Options `shareddriveadminquery|query` and `shareddrives|teamdrives` are mutually
Options `shareddriveadminquery|query` and `orgunit|org|ou` require `adminaccess|asadmin`. Options `shareddriveadminquery|query` and `orgunit|org|ou` require `adminaccess|asadmin`.
By default, organizers for all Shared Drives are displayed; use the following options to select a subset of Shared Drives: By default, organizers for all Shared Drives are displayed; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QuerySharedDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `shareddrives|teamdrives <SharedDriveIDList>` - Select the Shared Drive IDs specified in `<SharedDriveIDList>` * `shareddrives|teamdrives <SharedDriveIDList>` - Select the Shared Drive IDs specified in `<SharedDriveIDList>`
* `shareddrives|teamdrives select <FileSelector>|<CSVFileSelector>` - Select the Shared Drive IDs specified in `<FileSelector>|<CSVFileSelector>` * `shareddrives|teamdrives select <FileSelector>|<CSVFileSelector>` - Select the Shared Drive IDs specified in `<FileSelector>|<CSVFileSelector>`
* `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
@@ -535,12 +535,12 @@ gam print shareddrives query "organizerCount = 0"
Display the number of Shared Drives. Display the number of Shared Drives.
``` ```
gam [<UserTypeEntity>] show|print shareddrives gam [<UserTypeEntity>] show|print shareddrives
[adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>] [adminaccess|asadmin] [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
showitemcountonly showitemcountonly
``` ```
By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives: By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QuerySharedDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern. * `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 * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
@@ -758,7 +758,7 @@ gam config csv_output_header_drop_filter "User,createdTime,permission.photoLink,
## Display Shared Drive access for selected Shared Drives ## Display Shared Drive access for selected Shared Drives
``` ```
gam [<UserTypeEntity>] show shareddriveacls gam [<UserTypeEntity>] show shareddriveacls
[adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>] [adminaccess|asadmin] [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
[user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)* [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
<PermissionMatch>* [<PermissionMatchAction>] [pmselect] <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
@@ -767,7 +767,7 @@ gam [<UserTypeEntity>] show shareddriveacls
[formatjson] [formatjson]
gam [<UserTypeEntity>] print shareddriveacls [todrive <ToDriveAttribute>*] gam [<UserTypeEntity>] print shareddriveacls [todrive <ToDriveAttribute>*]
[adminaccess|asadmin] [shareddriveadminquery|query <QuerySharedDrive>] [adminaccess|asadmin] [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
[user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)* [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
<PermissionMatch>* [<PermissionMatchAction>] [pmselect] <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
@@ -777,7 +777,7 @@ gam [<UserTypeEntity>] print shareddriveacls [todrive <ToDriveAttribute>*]
``` ```
By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QuerySharedDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern. * `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 * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
* `<PermissionMatch>* [<PermissionMatchAction>] pmselect` - Use permission matching to select Shared Drives; all ACLs are displayed for the selected Shared Drives * `<PermissionMatch>* [<PermissionMatchAction>] pmselect` - Use permission matching to select Shared Drives; all ACLs are displayed for the selected Shared Drives
@@ -927,12 +927,12 @@ gam redirect stdout ./DeleteSharedDrives.txt multiprocess redirect stderr stdout
## Delete old empty Shared Drives ## Delete old empty Shared Drives
``` ```
# Get a list of Shared Drives organizers for Shared Drives created before one year ago; alter date<-1y as required. # Get a list of Shared Drives organizers for Shared Drives created before one year ago; alter date<-1y as required.
gam config csv_output_row_filter "createdTime:date<-1y" redirect csv ./ShareddriveOrganizers.csv print shareddriveorganizers domainlist mydomain.com includetypes user oneorganizer shownoorganizerdrives gam config csv_output_row_filter "createdTime:date<-1y" redirect csv ./TeamDriveOrganizers.csv print shareddriveorganizers domainlist mydomain.com includetypes user oneorganizer shownoorganizerdrives
# Inspect shareddriveOrganizers.csv, you'll have to deal with Shared Drives with no organizer/manager # Inspect shareddriveOrganizers.csv, you'll have to deal with Shared Drives with no organizer/manager
# Get old empty Shared Drives # Get old empty Shared Drives
gam config num_threads 10 csv_input_row_filter "organizers:regex:^.+$" csv_output_row_filter "Total:count=0" redirect csv ./OldEmptySharedDrives.csv multiprocess redirect stderr - multiprocess csv ./ShareddriveOrganizers.csv gam user "~organizers" print filecounts select shareddriveid "~id" showsize gam config num_threads 10 csv_input_row_filter "organizers:regex:^.+$" csv_output_row_filter "Total:count=0" redirect csv ./OldEmptySharedDrives.csv multiprocess redirect stderr - multiprocess csv ./TeamDriveOrganizers.csv gam user "~organizers" print filecounts select shareddriveid "~id" showsize
# Inspect OldEmptySharedDrives.csv, if you're confident of the results, proceed # Inspect OldEmptySharedDrives.csv, if you're confident of the results, proceed

View File

@@ -18,8 +18,8 @@
<SharedDriveID> ::= <String> <SharedDriveID> ::= <String>
<SharedDriveName> ::= <String> <SharedDriveName> ::= <String>
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveID>|(shareddriveid <SharedDriveID>)|(shareddriveid:<SharedDriveID>)| <SharedDriveID>|(teamdriveid <SharedDriveID>)|(teamdriveid:<SharedDriveID>)|
(shareddrive <SharedDriveName>)|(shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>)|(teamdrive:<SharedDriveName>)
``` ```
## Display empty folders ## Display empty folders
``` ```

View File

@@ -68,10 +68,10 @@
(parentid <DriveFolderID>)| (parentid <DriveFolderID>)|
(parentname <DriveFolderName>)| (parentname <DriveFolderName>)|
(anyownerparentname <DriveFolderName>)| (anyownerparentname <DriveFolderName>)|
(shareddriveparentid <DriveFolderID>)| (teamdriveparentid <DriveFolderID>)|
(shareddriveparent <SharedDriveName>)| (teamdriveparent <SharedDriveName>)|
(shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>)| (teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>)|
(shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>) (teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>)
<DriveFileCopyAttribute> ::= <DriveFileCopyAttribute> ::=
(contentrestrictions readonly false)| (contentrestrictions readonly false)|
@@ -120,7 +120,6 @@ gam <UserTypeEntity> copy drivefile <DriveFileEntity>
[copyfilepermissions [<Boolean>]] [copyfilepermissions [<Boolean>]]
[copyfileinheritedpermissions [<Boolean>] [copyfileinheritedpermissions [<Boolean>]
[copyfilenoninheritedpermissions [<Boolean>] [copyfilenoninheritedpermissions [<Boolean>]
[copyfolderpermissions [<Boolean>]]
[copymergewithparentfolderpermissions [<Boolean>]] [copymergewithparentfolderpermissions [<Boolean>]]
[copymergedtopfolderpermissions [<Boolean>]] [copymergedtopfolderpermissions [<Boolean>]]
[copytopfolderpermissions [<Boolean>]] [copytopfolderpermissions [<Boolean>]]
@@ -232,10 +231,10 @@ and "Template" is replaced by "NewCustomer" in all copied sub files and folders
* `parentid <DriveFolderID>` - The target folder is identified by `<DriveFolderID>` which must be writable by `<UserTypeEntity>`. * `parentid <DriveFolderID>` - The target folder is identified by `<DriveFolderID>` which must be writable by `<UserTypeEntity>`.
* `parentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by `<UserTypeEntity>`. * `parentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by `<UserTypeEntity>`.
* `anyownerparentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by any user but must be writable by `<UserTypeEntity>`. * `anyownerparentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by any user but must be writable by `<UserTypeEntity>`.
* `shareddriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder. * `teamdriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder.
* `shareddriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. * `teamdriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive.
* `shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive. * `teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive.
* `shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive. * `teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive.
* If none of the parent options are specified, the copied file/folder will be located in the source folder. * If none of the parent options are specified, the copied file/folder will be located in the source folder.
### Duplicate files ### Duplicate files
@@ -295,8 +294,6 @@ When a folder is copied, its permissions are not copied; these options control c
of the form `option [<Boolean>]`; if `<Boolean>` is omitted, `true` is assumed. of the form `option [<Boolean>]`; if `<Boolean>` is omitted, `true` is assumed.
When copied, a target folder inherits the permissions of its parent folder; these options control whether/how GAM copies the existing source folder permissions. When copied, a target folder inherits the permissions of its parent folder; these options control whether/how GAM copies the existing source folder permissions.
* `copyfolderpermissions false` - The permissions of the source folders are not copied to the target folder.
* `copyfolderpermissions true` - The permissions of the source folders are copied to the target folder based on the following options; this is the default action.
When `mergewithparent` is `true`: When `mergewithparent` is `true`:
* `copymergewithparentfolderpermissions false` - The permissions of the source top folder are not not copied to the target folder; this is the default action. * `copymergewithparentfolderpermissions false` - The permissions of the source top folder are not not copied to the target folder; this is the default action.
@@ -417,15 +414,15 @@ Specify the target location on the Shared Drive, either the ID of the Shared Dri
Files/folders in root of My Drive will be merged into `<DriveFolderID>` Files/folders in root of My Drive will be merged into `<DriveFolderID>`
``` ```
gam user user@domain.com copy drivefile root recursive shareddriveparentid <DriveFolderID> mergewithparent true gam user user@domain.com copy drivefile root recursive teamdriveparentid <DriveFolderID> mergewithparent true
``` ```
Files/folders in root of My Drive will be in a new folder named `My Drive` created in `<DriveFolderID>` Files/folders in root of My Drive will be in a new folder named `My Drive` created in `<DriveFolderID>`
``` ```
gam user user@domain.com copy drivefile root recursive shareddriveparentid <DriveFolderID> mergewithparent false gam user user@domain.com copy drivefile root recursive teamdriveparentid <DriveFolderID> mergewithparent false
``` ```
Files/folders in root of My Drive will be in a new folder named `<String>` created in `<DriveFolderID>` Files/folders in root of My Drive will be in a new folder named `<String>` created in `<DriveFolderID>`
``` ```
gam user user@domain.com copy drivefile root recursive shareddriveparentid <SharedDriveID> mergewithparent false newfilename <String> gam user user@domain.com copy drivefile root recursive teamdriveparentid <SharedDriveID> mergewithparent false newfilename <String>
``` ```
### Copy content of a Shared Drive to another Shared Drive ### Copy content of a Shared Drive to another Shared Drive
@@ -441,7 +438,7 @@ The example is assuming that the target drive is empty.
* Non-inherited sub folder permissions are copied. * Non-inherited sub folder permissions are copied.
* Non-inherited file permissions are copied. * Non-inherited file permissions are copied.
``` ```
gam user user@domain.com copy drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX mergewithparent recursive gam user user@domain.com copy drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX mergewithparent recursive
copymergewithparentfolderpermissions true copymergewithparentfolderpermissions true
copytopfolderinheritedpermissions false copytopfolderinheritedpermissions false
copytopfoldernoninheritedpermissions always copytopfoldernoninheritedpermissions always
@@ -461,7 +458,7 @@ Suppose that the source drive has been updated and you want to refresh the targe
* Non-inherited file permissions are copied. * Non-inherited file permissions are copied.
* Files and folders that have been deleted from the source drive will remain on the target drive * Files and folders that have been deleted from the source drive will remain on the target drive
``` ```
gam user user@domain.com copy drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX mergewithparent recursive gam user user@domain.com copy drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX mergewithparent recursive
copymergewithparentfolderpermissions true copymergewithparentfolderpermissions true
copytopfolderinheritedpermissions false copytopfolderinheritedpermissions false
copytopfoldernoninheritedpermissions syncallfolders copytopfoldernoninheritedpermissions syncallfolders
@@ -481,7 +478,7 @@ gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 0AC
``` ```
Copy the top level items to target Shared Drive; append desired permission options Copy the top level items to target Shared Drive; append desired permission options
``` ```
gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid 0AE_9ZX gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive teamdriveparentid 0AE_9ZX
``` ```
### Copy content of a source Shared Drive folder to a target Shared Drive with parallel Processing ### Copy content of a source Shared Drive folder to a target Shared Drive with parallel Processing
@@ -491,31 +488,31 @@ gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 1Bx
``` ```
Create a folder on target Shared Drive with ID 0AE_9ZX, replace "New Folder Name" as desired. Create a folder on target Shared Drive with ID 0AE_9ZX, replace "New Folder Name" as desired.
``` ```
gam user user@domain.com create drivefile mimetype gfolder shareddriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly gam user user@domain.com create drivefile mimetype gfolder teamdriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly
``` ```
Copy the folder top level items to target Shared Drive folder, assume ID 2CY-45G was returned in previous step Copy the folder top level items to target Shared Drive folder, assume ID 2CY-45G was returned in previous step
``` ```
gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid 2CY-45G gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive teamdriveparentid 2CY-45G
``` ```
You can script the steps: You can script the steps:
Linux/MacOS Linux/MacOS
``` ```
gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 1Bx-8W3 fields id,name,mimetype depth 0 gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 1Bx-8W3 fields id,name,mimetype depth 0
targetFolderId=$(gam user user@domain.com create drivefile mimetype gfolder shareddriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly) targetFolderId=$(gam user user@domain.com create drivefile mimetype gfolder teamdriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly)
gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid $targetFolderId gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive teamdriveparentid $targetFolderId
``` ```
Windows PowerShell Windows PowerShell
``` ```
gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 1Bx-8W3 fields id,name,mimetype depth 0 gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 1Bx-8W3 fields id,name,mimetype depth 0
$targetFolderId = & gam user user@domain.com create drivefile mimetype gfolder shareddriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly $targetFolderId = & gam user user@domain.com create drivefile mimetype gfolder teamdriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly
gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid $targetFolderId gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive teamdriveparentid $targetFolderId
``` ```
Windows Command Prompt Windows Command Prompt
``` ```
gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 1Bx-8W3 fields id,name,mimetype depth 0 gam redirect csv ./TopSDItems.csv user user@domain.com print filelist select 1Bx-8W3 fields id,name,mimetype depth 0
for /f "delims=" %a in ('gam user user@domain.com create drivefile mimetype gfolder shareddriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly') do set taregtFolderId=%a for /f "delims=" %a in ('gam user user@domain.com create drivefile mimetype gfolder teamdriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly') do set taregtFolderId=%a
gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid %targetFolderId% gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive teamdriveparentid %targetFolderId%
``` ```
## Move files and folders ## Move files and folders
@@ -574,7 +571,6 @@ gam <UserTypeEntity> move drivefile <DriveFileEntity> [newfilename <DriveFileNam
[createshortcutsfornonmovablefiles [<Boolean>]] [createshortcutsfornonmovablefiles [<Boolean>]]
[duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip] [duplicatefiles overwriteolder|overwriteall|duplicatename|uniquename|skip]
[duplicatefolders merge|duplicatename|uniquename|skip] [duplicatefolders merge|duplicatename|uniquename|skip]
[copyfolderpermissions [<Boolean>]]
[copymergewithparentfolderpermissions [<Boolean>]] [copymergewithparentfolderpermissions [<Boolean>]]
[copymergedtopfolderpermissions [<Boolean>]] [copymergedtopfolderpermissions [<Boolean>]]
[copytopfolderpermissions [<Boolean>]] [copytopfolderpermissions [<Boolean>]]
@@ -618,10 +614,10 @@ This is the default mode.
* `parentid <DriveFolderID>` - The target folder is identified by `<DriveFolderID>` which must be writable by `<UserTypeEntity>`. * `parentid <DriveFolderID>` - The target folder is identified by `<DriveFolderID>` which must be writable by `<UserTypeEntity>`.
* `parentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by `<UserTypeEntity>`. * `parentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by `<UserTypeEntity>`.
* `anyownerparentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by any user but must be writable by `<UserTypeEntity>`. * `anyownerparentname <DriveFolderName>` - A search is performed for a folder named `<DriveFolderName>` owned by any user but must be writable by `<UserTypeEntity>`.
* `shareddriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder. * `teamdriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder.
* `shareddriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. * `teamdriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive.
* `shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive. * `teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive.
* `shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive. * `teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive.
* If none of the parent options are specified, the moved file/folder will be located in the source folder. * If none of the parent options are specified, the moved file/folder will be located in the source folder.
### Duplicate files ### Duplicate files
@@ -664,8 +660,6 @@ When a folder is moved by recreating it, its permissions are not copied by the D
For options of the form `option [<Boolean>]`; if `<Boolean>` is omitted, `true` is assumed. For options of the form `option [<Boolean>]`; if `<Boolean>` is omitted, `true` is assumed.
When recreated, a target folder inherits the permissions of its parent folder; these options control whether/how GAM copies the existing source folder permissions; When recreated, a target folder inherits the permissions of its parent folder; these options control whether/how GAM copies the existing source folder permissions;
* `copyfolderpermissions false` - The permissions of the source folders are not copied to the target folder.
* `copyfolderpermissions true` - The permissions of the source folders are copied to the target folder based on the following options; this is the default action.
When `mergewithparent` is `true`: When `mergewithparent` is `true`:
* `copymergewithparentfolderpermissions false` - The permissions of the source top folder are not not copied to the target folder; this is the default action. * `copymergewithparentfolderpermissions false` - The permissions of the source top folder are not not copied to the target folder; this is the default action.
@@ -767,14 +761,14 @@ The following command will change the parents of the top level files and folders
* No permissions are processed. * No permissions are processed.
``` ```
gam user user@domain.com move drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX mergewithparent gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX mergewithparent
``` ```
If you want the source Shared Drive with ID 0AC_1AB to be contained in a top level folder of the target Shared Drive with ID 0AE_9ZX, omit the `mergewithparent` argument. If you want the source Shared Drive with ID 0AC_1AB to be contained in a top level folder of the target Shared Drive with ID 0AE_9ZX, omit the `mergewithparent` argument.
The folder on the target Shared Drive will have the same name as the name of the source Shared Drive; use the `newfilename <DriveFileName>` to use a different name. The folder on the target Shared Drive will have the same name as the name of the source Shared Drive; use the `newfilename <DriveFileName>` to use a different name.
``` ```
gam user user@domain.com move drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX
gam user user@domain.com move drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX newfilename "Copy of source Shared Drive" gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX newfilename "Copy of source Shared Drive"
``` ```
### Inter-workspace moves ### Inter-workspace moves
@@ -784,7 +778,7 @@ Due to a restructuring, you want to move data from Shared Drive A in domaina.com
* `user@domaina.com` is a manager of both Shared Drives. * `user@domaina.com` is a manager of both Shared Drives.
``` ```
$ gam user user@domaina move drivefile shareddriveid <SharedDriveAID> shareddriveparentid <SharedDriveBID> mergewithparent $ gam user user@domaina move drivefile teamdriveid <SharedDriveAID> teamdriveparentid <SharedDriveBID> mergewithparent
User: user@domaina.com, Move 1 Drive File/Folder 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 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 File: Filename(<FileID>), Move Failed: Bad Request. User message: "shareOutNotPermitted"
@@ -800,13 +794,13 @@ The following command will change the parents of the top level files and folders
* No permissions are processed. * No permissions are processed.
``` ```
gam user user@domain.com move drivefile shareddriveid 0AC_1AB parentid root mergewithparent gam user user@domain.com move drivefile teamdriveid 0AC_1AB parentid root mergewithparent
``` ```
If you want the contents of Shared Drive with ID 0AC_1AB to be contained in a top level folder of the My Drive, omit the `mergewithparent` argument. If you want the contents of Shared Drive with ID 0AC_1AB to be contained in a top level folder of the My Drive, omit the `mergewithparent` argument.
The folder on the My Drive will have the same name as the name of the Shared Drive; use the `newfilename <DriveFileName>` to use a different name. The folder on the My Drive will have the same name as the name of the Shared Drive; use the `newfilename <DriveFileName>` to use a different name.
``` ```
gam user user@domain.com move drivefile shareddriveid 0AC_1AB parentid root gam user user@domain.com move drivefile teamdriveid 0AC_1AB parentid root
gam user user@domain.com move drivefile shareddriveid 0AC_1AB parentid root newfilename "Copy of Shared Drive" gam user user@domain.com move drivefile teamdriveid 0AC_1AB parentid root newfilename "Copy of Shared Drive"
``` ```

View File

@@ -65,9 +65,9 @@
<SharedDriveID> ::= <String> <SharedDriveID> ::= <String>
<SharedDriveName> ::= <String> <SharedDriveName> ::= <String>
<SharedDriveIDEntity> ::= (shareddriveid <SharedDriveID>) | (shareddriveid:<SharedDriveID>) <SharedDriveIDEntity> ::= (teamdriveid <SharedDriveID>) | (teamdriveid:<SharedDriveID>)
<SharedDriveNameEntity> ::= (shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) <SharedDriveNameEntity> ::= (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
<SharedDriveFileNameEntity> ::= (shareddrivefilename <DriveFileName>) | (shareddrivefilename:<DriveFileName>) <SharedDriveFileNameEntity> ::= (teamdrivefilename <DriveFileName>) | (teamdrivefilename:<DriveFileName>)
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveIDEntity> | <SharedDriveIDEntity> |
@@ -315,8 +315,8 @@
size| size|
spaces| spaces|
starred| starred|
shareddriveid| teamdriveid|
shareddrivename| teamdrivename|
thumbnaillink| thumbnaillink|
thumbnailversion| thumbnailversion|
title| title|
@@ -619,10 +619,8 @@ This option is not available for `print|show filetree`.
``` ```
((query <QueryDriveFile>) | (fullquery <QueryDriveFile>) | <DriveFileQueryShortcut>) (querytime<String> <Time>)* ((query <QueryDriveFile>) | (fullquery <QueryDriveFile>) | <DriveFileQueryShortcut>) (querytime<String> <Time>)*
``` ```
GAM initializes the query to `'me' in owners`.
* `query "xxx"` - ` and xxx` is appended to the current query; you can repeat the query argument to build up a longer query. * `query "xxx"` - ` and xxx` is appended to the current query; you can repeat the query argument to build up a longer query.
* `fullquery "xxx"` - The query is set to `xxx` eliminating the initial `'me' in owners`. You must also use `showownedby any|others` as desired. * `fullquery "xxx"` - The query is set to `xxx` eliminating the initial `'me' in owners`.
* `<DriveFileQueryShortcut>` - Predefined queries * `<DriveFileQueryShortcut>` - Predefined queries
Use the `querytime<String> <Time>` option to allow times, usually relative, to be substituted into the `query <QueryDriveFile>` option. Use the `querytime<String> <Time>` option to allow times, usually relative, to be substituted into the `query <QueryDriveFile>` option.

View File

@@ -149,10 +149,10 @@
(parentid <DriveFolderID>)| (parentid <DriveFolderID>)|
(parentname <DriveFolderName>)| (parentname <DriveFolderName>)|
(anyownerparentname <DriveFolderName>)| (anyownerparentname <DriveFolderName>)|
(shareddriveparentid <DriveFolderID>)| (teamdriveparentid <DriveFolderID>)|
(shareddriveparent <SharedDriveName>)| (teamdriveparent <SharedDriveName>)|
(shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>)| (teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>)|
(shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>) (teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>)
<DriveFileCreateAttribute> ::= <DriveFileCreateAttribute> ::=
<DriveFileAttribute>| <DriveFileAttribute>|
@@ -196,10 +196,10 @@ You can specify where the new file is to be located:
* `parentid <DriveFolderID>` - Folder ID. * `parentid <DriveFolderID>` - Folder ID.
* `parentname <DriveFolderName>` - Folder name; the folder must be owned by `<UserTypeEntity>`. * `parentname <DriveFolderName>` - Folder name; the folder must be owned by `<UserTypeEntity>`.
* `anyownerparentname <DriveFolderName>` - Folder name; the folder can be owned by any user, `<UserTypeEntity>` must be able to write to the folder. * `anyownerparentname <DriveFolderName>` - Folder name; the folder can be owned by any user, `<UserTypeEntity>` must be able to write to the folder.
* `shareddriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. * `teamdriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder.
* `shareddriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. * `teamdriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive.
* `shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive. * `teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive.
* `shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive. * `teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive.
* If none of the parent options are specified, the parent folder is the root folder. * If none of the parent options are specified, the parent folder is the root folder.
By default, Google assigns the current time to the attributes `createdTime` and `modifiedTime`; you can assign your own values By default, Google assigns the current time to the attributes `createdTime` and `modifiedTime`; you can assign your own values
@@ -290,7 +290,7 @@ This will create a three column CSV file SharedDriveNamesIDs.csv with columns: U
You are building student folders on a Shared Drive as an admin and want to add ACLs to the folders You are building student folders on a Shared Drive as an admin and want to add ACLs to the folders
allowing the student write access and you want a shortcut on the student's My Drive pointing to the folder. allowing the student write access and you want a shortcut on the student's My Drive pointing to the folder.
By adding the student's primary email address to the CSV output, it can be used in subsequent commands. By adding the student's primary email address to the CSV output, it can be used in subsequent commands.
Sustitute for admin@domain.com and `<SharedDriveID>`. Sustitute for admin@domain.com and `<TeamDriveID>`.
``` ```
Students.csv Students.csv
primaryEmail,Name primaryEmail,Name
@@ -299,7 +299,7 @@ mary@domain.com, Mary Smith
... ...
# Create the student folders on the Shared Drive # Create the student folders on the Shared Drive
gam redirect csv ./StudentFolders.csv multiprocess csv Students.csv gam user admin@domain.com create drivefile mimetype gfolder drivefilename "~~Name~~ Digital Portfolio" parentid <SharedDriveID> csv addcsvdata primaryEmail "~primaryEmail" gam redirect csv ./StudentFolders.csv multiprocess csv Students.csv gam user admin@domain.com create drivefile mimetype gfolder drivefilename "~~Name~~ Digital Portfolio" parentid <TeamDriveID> csv addcsvdata primaryEmail "~primaryEmail"
# Add ACLs granting the students write access to their folders; "~User" refers to admin@domain.com # Add ACLs granting the students write access to their folders; "~User" refers to admin@domain.com
gam csv StudentFolders.csv gam user "~User" add drivefileacl "~id" user "~primaryEmail" role fileorganizer gam csv StudentFolders.csv gam user "~User" add drivefileacl "~id" user "~primaryEmail" role fileorganizer
# Add a shortcut to the folder on the student's My Drive # Add a shortcut to the folder on the student's My Drive
@@ -389,7 +389,7 @@ User: user@domain.com, Drive Folder Path:, Create
Build in a Shared Drive Folder Build in a Shared Drive Folder
``` ```
gam user user@domain.com create drivefolderpath path "Top Folder/Middle Folder/Bottom Folder/Sub Folder" shareddriveparent "TS Shared Drive" shareddriveparentname "TS SD6 Folder" gam user user@domain.com create drivefolderpath path "Top Folder/Middle Folder/Bottom Folder/Sub Folder" teamdriveparent "TS Shared Drive" teamdriveparentname "TS SD6 Folder"
Getting all Drive Files/Folders that match query (mimeType = 'application/vnd.google-apps.folder' and name = 'TS SD6 Folder' and trashed = false) for user@domain.com Getting all Drive Files/Folders that match query (mimeType = 'application/vnd.google-apps.folder' and name = 'TS SD6 Folder' and trashed = false) for user@domain.com
Got 1 Drive File/Folder that matched query (mimeType = 'application/vnd.google-apps.folder' and name = 'TS SD6 Folder' and trashed = false) for user@domain.com... Got 1 Drive File/Folder that matched query (mimeType = 'application/vnd.google-apps.folder' and name = 'TS SD6 Folder' and trashed = false) for user@domain.com...
User: user@domain.com, Drive Folder Path:, Create User: user@domain.com, Drive Folder Path:, Create
@@ -495,10 +495,10 @@ You can change where the new file is to be located; this removes all other paren
* `parentid <DriveFolderID>` - Folder ID. * `parentid <DriveFolderID>` - Folder ID.
* `parentname <DriveFolderName>` - Folder name; the folder must be owned by `<UserTypeEntity>`. * `parentname <DriveFolderName>` - Folder name; the folder must be owned by `<UserTypeEntity>`.
* `anyownerparentname <DriveFolderName>` - Folder name; the folder can be owned by any user, `<UserTypeEntity>` must be able to write to the folder. * `anyownerparentname <DriveFolderName>` - Folder name; the folder can be owned by any user, `<UserTypeEntity>` must be able to write to the folder.
* `shareddriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. * `teamdriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder.
* `shareddriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. * `teamdriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive.
* `shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive. * `teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive.
* `shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive. * `teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive.
You can add/remove parent folders without affecting other parent folders. You can add/remove parent folders without affecting other parent folders.
* `addparents|removeparents <DriveFolderIDList>` - Specify the parent folders by ID. * `addparents|removeparents <DriveFolderIDList>` - Specify the parent folders by ID.

View File

@@ -30,13 +30,13 @@
(parentid <DriveFolderID>)| (parentid <DriveFolderID>)|
(parentname <DriveFolderName>)| (parentname <DriveFolderName>)|
(anyownerparentname <DriveFolderName>)| (anyownerparentname <DriveFolderName>)|
(shareddriveparentid <DriveFolderID>)| (teamdriveparentid <DriveFolderID>)|
(shareddriveparent <SharedDriveName>)| (teamdriveparent <SharedDriveName>)|
(shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>)| (teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>)|
(shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>))| (teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>))|
(shareddriveparentid <DriveFolderID>)|(shareddriveparent <SharedDriveName>)| (teamdriveparentid <DriveFolderID>)|(teamdriveparent <SharedDriveName>)|
(shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>)| (teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>)|
(shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>) (teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>)
<DriveOrderByFieldName> ::= <DriveOrderByFieldName> ::=
createddate|createdtime| createddate|createdtime|

View File

@@ -15,7 +15,6 @@
- [Remove domainCanFind-domainWithLink ACLs for internal domain](#remove-domaincanfind-domainwithlink-acls-for-internal-domain) - [Remove domainCanFind-domainWithLink ACLs for internal domain](#remove-domaincanfind-domainwithlink-acls-for-internal-domain)
- [Remove My Drive ACLs for external domains](#remove-my-drive-acls-for-external-domains) - [Remove My Drive ACLs for external domains](#remove-my-drive-acls-for-external-domains)
- [Remove anyoneCanFind-anyoneWithLink ACLs](#remove-anyonecanfind-anyonewithlink-acls) - [Remove anyoneCanFind-anyoneWithLink ACLs](#remove-anyonecanfind-anyonewithlink-acls)
- [Target Audiences](#target-audiences)
## API documentation ## API documentation
* [Drive API - Permissions](https://developers.google.com/drive/api/v3/reference/permissions) * [Drive API - Permissions](https://developers.google.com/drive/api/v3/reference/permissions)
@@ -144,7 +143,6 @@ specify `basicpermissions` and additional permission fields, e.g., `permissions.
<FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVDataSelector> <FileSelector> | <CSVFileSelector> | <CSVkmdSelector> | <CSVDataSelector>
See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items See: https://github.com/GAM-team/GAM/wiki/Collections-of-Items
``` ```
## GUI API permission name mapping ## GUI API permission name mapping
| GUI setting | API setting | | GUI setting | API setting |
@@ -359,8 +357,8 @@ The `quotechar <Character>` option allows you to choose an alternate quote chara
For example, to get the ACLs for your Team Drives with the Team Drive name included in the output: For example, to get the ACLs for your Team Drives with the Team Drive name included in the output:
``` ```
gam redirect csv ./SharedDrives.csv print shareddrives gam redirect csv ./TeamDrives.csv print teamdrives
gam redirect csv ./SharedDriveACLs.csv multiprocess csv ./SharedDrives.csv gam print drivefileacls shareddriveid "~id" addtitle "~name" fields id,domain,emailaddress,role,type,deleted gam redirect csv ./TeamDriveACLs.csv multiprocess csv ./TeamDrives.csv gam print drivefileacls teamdriveid "~id" addtitle "~name" fields id,domain,emailaddress,role,type,deleted
``` ```
## Delete all ACLs except owner from a file ## Delete all ACLs except owner from a file
@@ -618,51 +616,3 @@ Delete those Shared Drive ACLs.
``` ```
gam config num_threads 20 redirect stdout ./DeleteSharedDriveShares.txt multiprocess redirect stderr stdout csv SharedDriveShares.csv gam user "~Owner" delete drivefileacl "~id" "id:~~permission.id~~" gam config num_threads 20 redirect stdout ./DeleteSharedDriveShares.txt multiprocess redirect stderr stdout csv SharedDriveShares.csv gam user "~Owner" delete drivefileacl "~id" "id:~~permission.id~~"
``` ```
## Target Audiences
* See: https://support.google.com/a/answer/9934697
You can manage target audiences in the admin console at Directory/Target audiences.
If you click on a target audience the URL will look like this: `https://admin.google.com/ac/targetaudiences/02xcytpi0xrdqxi`
You can add this target audience to a file with:
```
gam user user@domain.com create drivefileacl <DriveFileID> domain 02xcytpi0xrdqxi.audience.googledomains.com role reader
User: user@domain.com, Add 1 Drive File/Folder ACL
User: user@domain.com, Drive File/Folder ID: <DriveFileID>, Permission ID: 02xcytpi0xrdqxi.audience.googledomains.com, Added
Test Audience
id: 02897912034288871303
type: domain
domain: 02xcytpi0xrdqxi.audience.googledomains.com
role: reader
permissionDetails:
role: reader
type: file
inherited: False
allowFileDiscovery: False
```
You can update the target audience role with:
```
gam user user@domain.com update drivefileacl <DriveFileID> id:02897912034288871303 role writer
User: user@domain.com, Update 1 Drive File/Folder ACL
User: user@domain.com, Drive File/Folder ID: <DriveFileID>, Permission ID: 02897912034288871303, Updated
Test Audience
id: 02897912034288871303
type: domain
domain: 02xcytpi0xrdqxi.audience.googledomains.com
role: writer
permissionDetails:
role: writer
type: file
inherited: False
allowFileDiscovery: False
```
You can delete the target audience from a file with:
```
gam user user@domain.com delete drivefileacl <DriveFileID> id:02897912034288871303
User: user@domain.com, Delete 1 Drive File/Folder ACL
User: user@domain.com, Drive File/Folder ID: <DriveFileID>, Permission ID: 02897912034288871303, Deleted
```

View File

@@ -26,10 +26,10 @@
(parentid <DriveFolderID>)| (parentid <DriveFolderID>)|
(parentname <DriveFolderName>)| (parentname <DriveFolderName>)|
(anyownerparentname <DriveFolderName>)| (anyownerparentname <DriveFolderName>)|
(shareddriveparentid <DriveFolderID>)| (teamdriveparentid <DriveFolderID>)|
(shareddriveparent <SharedDriveName>)| (teamdriveparent <SharedDriveName>)|
(shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>)| (teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>)|
(shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>) (teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>)
``` ```
## Create shortcuts ## Create shortcuts
@@ -48,10 +48,10 @@ There are two modes of operaton:
* `parentid <DriveFolderID>` - Folder ID. * `parentid <DriveFolderID>` - Folder ID.
* `parentname <DriveFolderName>` - Folder name; the folder must be owned by `<UserTypeEntity>`. * `parentname <DriveFolderName>` - Folder name; the folder must be owned by `<UserTypeEntity>`.
* `anyownerparentname <DriveFolderName>` - Folder name; the folder can be owned by any user, `<UserTypeEntity>` must be able to write to the folder. * `anyownerparentname <DriveFolderName>` - Folder name; the folder can be owned by any user, `<UserTypeEntity>` must be able to write to the folder.
* `shareddriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. * `teamdriveparentid <DriveFolderID>` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder.
* `shareddriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. * `teamdriveparent <SharedDriveName>` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive.
* `shareddriveparentid <SharedDriveID> shareddriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive. * `teamdriveparentid <SharedDriveID> teamdriveparentname <DriveFolderName>` - A Shared Drive ID and a folder name on that Shared Drive.
* `shareddriveparent <SharedDriveName> shareddriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive. * `teamdriveparent <SharedDriveName> teamdriveparentname <DriveFolderName>` - A Shared Drive name and a folder name on that Shared Drive.
* `convertparents` - Convert all but the last parent reference in `<DriveFileEntity>` to shortcuts. My testing shows that as parents are added to a file, they are added to the front of the parents list; thus, the last parent is the original parent. * `convertparents` - Convert all but the last parent reference in `<DriveFileEntity>` to shortcuts. My testing shows that as parents are added to a file, they are added to the front of the parents list; thus, the last parent is the original parent.
If neither `<DriveFileParentAttribute>` nor `convertparents` are specified, the shortcut is placed in the root folder (My Drive). If neither `<DriveFileParentAttribute>` nor `convertparents` are specified, the shortcut is placed in the root folder (My Drive).
@@ -142,6 +142,6 @@ gam csv Shortcuts.csv matchfield code 4 gam user "~owner" create drivefileshortc
## Check shortcut validity on Shared Drives ## Check shortcut validity on Shared Drives
``` ```
gam redirect csv ./TDShortcuts.csv user organizer@domain.com print filelist select shareddriveid <SharedDriveID> showmimetype gshortcut fields id gam redirect csv ./TDShortcuts.csv user organizer@domain.com print filelist select teamdriveid <SharedDriveID> showmimetype gshortcut fields id
gam redirect csv ./Shortcuts.csv user organizer@domain.com check drivefileshortcut csvfile TDShortcuts.csv:id csv gam redirect csv ./Shortcuts.csv user organizer@domain.com check drivefileshortcut csvfile TDShortcuts.csv:id csv
``` ```

View File

@@ -404,7 +404,7 @@ Messages are archived to the group specified by `<GroupItem>`.
### Archive a selected set of messages ### Archive a selected set of messages
* `((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+` - Criteria to select messages * `((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+` - Criteria to select messages
* `labelids <LabelIDList>` - Select messages with labels that match all of the specified label IDs. * `labelids <LabelIDList>` - Select messages with labels that match all of the specified label IDs.
* `max_to_archive <Number>` - Limit the number of messages that will be archived; use a value of 0 for no limit * `max_to_archive <Number>` - Limit the number of messages that will be archived; use a value of 0 for no limit
* `doit` - No messages are archived unless you specify `doit`. By not specifying `doit`, you can preview the messages selected to verify that the results match your expectations. * `doit` - No messages are archived unless you specify `doit`. By not specifying `doit`, you can preview the messages selected to verify that the results match your expectations.
When `matchlabel <LabelName>` is specified, the following characters are replaced with a `-` in the generated query. When `matchlabel <LabelName>` is specified, the following characters are replaced with a `-` in the generated query.
@@ -430,6 +430,8 @@ user@domain.com,18e9fc6581b9acab,Archived,
user@domain.com,18e9fc58c5491f4c,Archived, user@domain.com,18e9fc58c5491f4c,Archived,
``` ```
See below for message selection.
## Export messages/threads ## Export messages/threads
Export messages in EML format. Export messages in EML format.
``` ```
@@ -462,18 +464,7 @@ By default, when exporting a message, an existing local file will not be overwri
* `overwrite true` - Overwite an existing file * `overwrite true` - Overwite an existing file
* `overwrite false` - Do not overwite an existing file; add a numeric prefix and create a new file * `overwrite false` - Do not overwite an existing file; add a numeric prefix and create a new file
### Export a specific set of messages See below for message selection.
* `ids <MessageIDEntity>` - A list of message ids
### Export a selected set of messages
* `((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+` - Criteria to select messages
* `labelids <LabelIDList>` - Select messages with labels that match all of the specified label IDs.
* `max_to_export <Number>` - Limit the number of messages that will be exported; use a value of 0 for no limit
When `matchlabel <LabelName>` is specified, the following characters are replaced with a `-` in the generated query.
```
&()"|{}/
```
## Forward messages/threads ## Forward messages/threads
``` ```
@@ -501,19 +492,7 @@ If `addorigfieldstosubject` is specified, GAM appends the original `from`, `to`
Fwd: Ross to TestUser (Original From: Ross Scroggs <ross.scroggs@gmail.com> To: testuser@domain.com Date: Thu, 23 Nov 2023 07:01:59 -0800) Fwd: Ross to TestUser (Original From: Ross Scroggs <ross.scroggs@gmail.com> To: testuser@domain.com Date: Thu, 23 Nov 2023 07:01:59 -0800)
``` ```
### Forward a specific set of messages See below for message selection.
* `ids <MessageIDEntity>` - A list of message ids
### Forward a selected set of messages
* `((query <QueryGmail> [querytime<String> <Date>]*) (matchlabel <LabelName>) [or|and])+` - Criteria to select messages
* `labelids <LabelIDList>` - Select messages with labels that match all of the specified label IDs.
* `max_to_forward <Number>` - Limit the number of messages that will be forwarded; use a value of 0 for no limit
* `doit` - No messages are processed unless you specify `doit`. By not specifying `doit`, you can preview the messages selected to verify that the results match your expectations.
When `matchlabel <LabelName>` is specified, the following characters are replaced with a `-` in the generated query.
```
&()"|{}/
```
## Manage messages/threads ## Manage messages/threads
``` ```

View File

@@ -1,6 +1,5 @@
# Users - Photo # Users - Photo
- [API documentation](#api-documentation) - [API documentation](#api-documentation)
- [Notes](#notes)
- [Definitions](#definitions) - [Definitions](#definitions)
- [Upload a user's photo from a default file](#upload-a-users-photo-from-a-default-file) - [Upload a user's photo from a default file](#upload-a-users-photo-from-a-default-file)
- [Upload a user's photo specifying file name](#upload-a-users-photo-specifying-file-name) - [Upload a user's photo specifying file name](#upload-a-users-photo-specifying-file-name)
@@ -8,16 +7,11 @@
- [Upload a user's photo specifying a Google Drive owner and file name](#upload-a-users-photo-specifying-a-google-drive-owner-and-file-name) - [Upload a user's photo specifying a Google Drive owner and file name](#upload-a-users-photo-specifying-a-google-drive-owner-and-file-name)
- [Download a user's photo](#download-a-users-photo) - [Download a user's photo](#download-a-users-photo)
- [Delete a user's photo](#delete-a-users-photo) - [Delete a user's photo](#delete-a-users-photo)
- [Update photo fails to change user's photo](#update-photo-fails-to-change-users-photo)
- [Download a user's profile photo](Users-Profile-Photo) - [Download a user's profile photo](Users-Profile-Photo)
## API documentation ## API documentation
* [Directory API - Users Photos](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users.photos) * [Directory API - Users Photos](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users.photos)
## Notes
As of version 7.34.09, `gam <UserTypeEntity> update photo` was updated to delete the user's existing photo
before performing the update as the API update will succeed but not replace a user's existing self-set photo.
## Definitions ## Definitions
* [`<DriveFileEntity>`](Drive-File-Selection) * [`<DriveFileEntity>`](Drive-File-Selection)
* [`<UserTypeEntity>`](Collections-of-Users) * [`<UserTypeEntity>`](Collections-of-Users)
@@ -87,7 +81,3 @@ By default, the Base64 encoded data is dumped to stdout.
``` ```
gam <UserTypeEntity> delete|del photo gam <UserTypeEntity> delete|del photo
``` ```
## Update photo fails to change user's photo
If you use `gam <UserTypeEntity> update photo ...` to change a user's photo and the command succeeds
but the photo doesn't change, use `gam <UserTypeEntity> delete photo` first and then do the update.

View File

@@ -148,8 +148,6 @@
<CSVkmdSelector> | <CSVkmdSelector> |
<CSVDataSelector> <CSVDataSelector>
<QuerySharedDrive> ::= <String> See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives
<SharedDriveACLRole> ::= <SharedDriveACLRole> ::=
manager|organizer|owner| manager|organizer|owner|
contentmanager|fileorganizer| contentmanager|fileorganizer|
@@ -161,8 +159,8 @@
<SharedDriveName> ::= <String> <SharedDriveName> ::= <String>
<SharedDriveEntity> ::= <SharedDriveEntity> ::=
<SharedDriveID>| <SharedDriveID>|
(shareddriveid <SharedDriveID>)|(shareddriveid:<SharedDriveID>)| (teamdriveid <SharedDriveID>)|(teamdriveid:<SharedDriveID>)|
(shareddrive <SharedDriveName>)|(shareddrive:<SharedDriveName>) (teamdrive <SharedDriveName>)|(teamdrive:<SharedDriveName>)
<SharedDriveFieldName> ::= <SharedDriveFieldName> ::=
backgroundimagefile| backgroundimagefile|
@@ -176,10 +174,10 @@
themeid themeid
<SharedDriveFieldNameList> ::= "<SharedDriveFieldName>(,<SharedDriveFieldName>)*" <SharedDriveFieldNameList> ::= "<SharedDriveFieldName>(,<SharedDriveFieldName>)*"
<SharedDriveIDEntity> ::= (shareddriveid <DriveFileItem>) | (shareddriveid:<DriveFileItem>) <SharedDriveIDEntity> ::= (teamdriveid <DriveFileItem>) | (teamdriveid:<DriveFileItem>)
<SharedDriveNameEntity> ::= (shareddrive <SharedDriveName>) | (shareddrive:<SharedDriveName>) <SharedDriveNameEntity> ::= (teamdrive <SharedDriveName>) | (teamdrive:<SharedDriveName>)
<SharedDriveFileNameEntity> ::= (shareddrivefilename <DriveFileName>) | (shareddrivefilename:<DriveFileName>) <SharedDriveFileNameEntity> ::= (teamdrivefilename <DriveFileName>) | (teamdrivefilename:<DriveFileName>)
<SharedDriveFileQueryEntity> ::= (shareddrivequery <QueryDriveFile>) | (shareddrivequery:<QueryDriveFile>) <SharedDriveFileQueryEntity> ::= (teamdrivequery <QueryDriveFile>) | (teamdrivequery:<QueryDriveFile>)
<SharedDriveFileQueryShortcut> ::= <SharedDriveFileQueryShortcut> ::=
all_files | all_folders | all_google_files | all_non_google_files | all_items all_files | all_folders | all_google_files | all_non_google_files | all_items
@@ -293,11 +291,11 @@ When either of these options is chosen, no infomation about Shared Drive restric
To retrieve the Shared Drive ID with `returnidonly`: To retrieve the Shared Drive ID with `returnidonly`:
``` ```
Linux/MacOS Linux/MacOS
shareddriveId=$(gam user user@domain.com create shareddrive ... returnidonly) teamDriveId=$(gam user user@domain.com create shareddrive ... returnidonly)
Windows PowerShell Windows PowerShell
$shareddriveId = & gam user user@domain.com create shareddrive ... returnidonly $teamDriveId = & gam user user@domain.com create shareddrive ... returnidonly
Windows Command Prompt Windows Command Prompt
for /f "delims=" %a in ('gam user user@domain.com create shareddrive ... returnidonly') do set shareddriveId=%a for /f "delims=" %a in ('gam user user@domain.com create shareddrive ... returnidonly') do set teamDriveId=%a
``` ```
## Bulk Create Shared Drives ## Bulk Create Shared Drives
@@ -419,12 +417,12 @@ The `quotechar <Character>` option allows you to choose an alternate quote chara
Display the number of Shared Drives. Display the number of Shared Drives.
``` ```
gam <UserTypeEntity> show|print shareddrives gam <UserTypeEntity> show|print shareddrives
[shareddriveadminquery|query <QuerySharedDrive>] [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
showitemcountonly showitemcountonly
``` ```
By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives: By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QuerySharedDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern. * `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 * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
@@ -468,7 +466,7 @@ Options `shareddriveadminquery|query` and `shareddrives|teamdrives` are mutually
Options `shareddriveadminquery|query` and `orgunit|org|ou` require `adminaccess|asadmin`. Options `shareddriveadminquery|query` and `orgunit|org|ou` require `adminaccess|asadmin`.
By default, organizers for all Shared Drives are displayed; use the following options to select a subset of Shared Drives: By default, organizers for all Shared Drives are displayed; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `shareddrives|teamdrives <SharedDriveIDList>` - Select the Shared Drive IDs specified in `<SharedDriveIDList>` * `shareddrives|teamdrives <SharedDriveIDList>` - Select the Shared Drive IDs specified in `<SharedDriveIDList>`
* `shareddrives|teamdrives select <FileSelector>|<CSVFileSelector>` - Select the Shared Drive IDs specified in `<FileSelector>|<CSVFileSelector>` * `shareddrives|teamdrives select <FileSelector>|<CSVFileSelector>` - Select the Shared Drive IDs specified in `<FileSelector>|<CSVFileSelector>`
* `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
@@ -488,7 +486,7 @@ To select organizers from any domain, use: `domainlist ""`
For example, to get a single user organizer from your domain for all Shared Drives including no organizer drives: For example, to get a single user organizer from your domain for all Shared Drives including no organizer drives:
``` ```
gam redirect csv ./ShareddriveOrganizers.csv print shareddriveorganizers gam redirect csv ./TeamDriveOrganizers.csv print shareddriveorganizers
``` ```
## Manage Shared Drive access ## Manage Shared Drive access
@@ -598,14 +596,14 @@ The `quotechar <Character>` option allows you to choose an alternate quote chara
## Display Shared Drive access for selected Shared Drives ## Display Shared Drive access for selected Shared Drives
``` ```
gam <UserTypeEntity> show shareddriveacls gam <UserTypeEntity> show shareddriveacls
adminaccess [shareddriveadminquery|query <QuerySharedDrive>] adminaccess [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
[user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)* [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
<PermissionMatch>* [<PermissionMatchAction>] [pmselect] <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
[oneitemperrow] [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)] [oneitemperrow] [<DrivePermissionsFieldName>*|(fields <DrivePermissionsFieldNameList>)]
[formatjson [quotechar <Character>]] [formatjson [quotechar <Character>]]
gam <UserTypeEntity> print shareddriveacls [todrive <ToDriveAttribute>*] gam <UserTypeEntity> print shareddriveacls [todrive <ToDriveAttribute>*]
adminaccess [shareddriveadminquery|query <QuerySharedDrive>] adminaccess [teamdriveadminquery|query <QueryTeamDrive>]
[matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>] [matchname <REMatchPattern>] [orgunit|org|ou <OrgUnitPath>]
[user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)* [user|group <EmailAddress> [checkgroups]] (role|roles <SharedDriveACLRoleList>)*
<PermissionMatch>* [<PermissionMatchAction>] [pmselect] <PermissionMatch>* [<PermissionMatchAction>] [pmselect]
@@ -617,7 +615,7 @@ Shared Drives in the workspace, `<UserTypeEntity>` should specify a super admin
option shoud be used. option shoud be used.
By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives:
* `shareddriveadminquery|query <QuerySharedDrive>` - Use a query to select Shared Drives * `teamdriveadminquery|query <QueryTeamDrive>` - Use a query to select Shared Drives
* `matchname <REMatchPattern>` - Retrieve Shared Drives with names that match a pattern. * `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 * `orgunit|org|ou <OrgUnitPath>` - Only Shared Drives in the specified Org Unit are selected
* `<PermissionMatch>* [<PermissionMatchAction>] pmselect` - Use permission matching to select Shared Drives * `<PermissionMatch>* [<PermissionMatchAction>] pmselect` - Use permission matching to select Shared Drives

View File

@@ -40,7 +40,6 @@
- [Print user list](#print-user-list) - [Print user list](#print-user-list)
- [Display user counts](#display-user-counts) - [Display user counts](#display-user-counts)
- [Verify domain membership](#verify-domain-membership) - [Verify domain membership](#verify-domain-membership)
- [Guest Users](#guest-users)
## API documentation ## API documentation
* [Directory API - Users](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users) * [Directory API - Users](https://developers.google.com/admin-sdk/directory/reference/rest/v1/users)
@@ -170,7 +169,6 @@ queries "`"orgUnitPath=\'/Students/Lower\ School/2027\'`",`"orgUnitPath=\'/Stude
fullname| fullname|
gender| gender|
givenname|firstname| givenname|firstname|
guestaccountinfo|
id| id|
ims|im| ims|im|
includeinglobaladdresslist|gal| includeinglobaladdresslist|gal|
@@ -178,7 +176,6 @@ queries "`"orgUnitPath=\'/Students/Lower\ School/2027\'`",`"orgUnitPath=\'/Stude
isdelegatedadmin|admin|isadmin| isdelegatedadmin|admin|isadmin|
isenforcedin2sv|is2svenforced| isenforcedin2sv|is2svenforced|
isenrolledin2sv|is2svenrolled| isenrolledin2sv|is2svenrolled|
isguestuser|
ismailboxsetup| ismailboxsetup|
keyword|keywords| keyword|keywords|
language|languages| language|languages|
@@ -1387,11 +1384,3 @@ testuser1@domain.com,118080758787650801331,True,Test User 1
testuserxxx@domain.com,,False,Test User XXX testuserxxx@domain.com,,False,Test User XXX
testuser2@domain.com,107344800159717682514,True,Test User 2 testuser2@domain.com,107344800159717682514,True,Test User 2
``` ```
## Guest Users
* See: https://support.google.com/a/answer/16558545
```
gam create guestuser <EmailAddress>
```
Guest users are in the OU "/Workspace guests".

View File

@@ -3,23 +3,23 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAM 7.34.09 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.33.03 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.2 64-bit final
macOS Tahoe 26.3 arm64 macOS Tahoe 26.2 x86_64
Path: /Users/gamteam/bin/gam7 Path: /Users/Admin/bin/gam7
Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2026-02-15T07:51:00-08:00 Time: 2025-12-23T13:57:00-08: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.34.09 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.33.03 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.2 64-bit final
macOS Tahoe 26.3 arm64 macOS Tahoe 26.2 x86_64
Path: /Users/gamteam/bin/gam7 Path: /Users/Admin/bin/gam7
Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Your system time differs from www.googleapis.com by less than 1 second Your system time differs from www.googleapis.com by less than 1 second
``` ```
@@ -27,29 +27,29 @@ 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.34.09 - https://github.com/GAM-team/GAM - pyinstaller GAM 7.33.03 - https://github.com/GAM-team/GAM - pyinstaller
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.2 64-bit final
macOS Tahoe 26.3 arm64 macOS Tahoe 26.2 x86_64
Path: /Users/gamteam/bin/gam7 Path: /Users/Admin/bin/gam7
Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2026-02-15T07:51:00-08:00 Time: 2025-12-23T13:57:00-08:00
Your system time differs from admin.googleapis.com by less than 1 second Your system time differs from admin.googleapis.com by less than 1 second
OpenSSL 3.6.1 27 Jan 2026 OpenSSL 3.6.1 27 Jan 2026
arrow 1.4.0 arrow 1.3.0
chardet 5.2.0 chardet 5.2.0
cryptography 46.0.5 cryptography 46.0.1
filelock 3.21.2 filelock 3.19.1
google-api-python-client 2.190.0 google-api-python-client 2.182.0
google-auth-httplib2 0.3.0 google-auth-httplib2 0.2.0
google-auth-oauthlib 1.2.4 google-auth-oauthlib 1.2.2
google-auth 2.48.0 google-auth 2.40.3
lxml 6.0.2 lxml 6.0.1
httplib2 0.31.2 httplib2 0.31.0
passlib 1.7.4 passlib 1.7.4
pathvalidate 3.3.1 pathvalidate 3.3.1
pyscard 2.3.1 pyscard 2.3.0
yubikey-manager 5.9.0 yubikey-manager 5.8.0
admin.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384 admin.googleapis.com connects using TLSv1.3 TLS_AES_256_GCM_SHA384
``` ```
@@ -65,10 +65,10 @@ google-api-python-client 2.77.0
httplib2 0.16.0 httplib2 0.16.0
oauth2client 4.1.3 oauth2client 4.1.3
MacOS High Sierra 10.13.6 x86_64 MacOS High Sierra 10.13.6 x86_64
Path: /Users/gamteam/bin/gam7 Path: /Users/Admin/bin/gam7
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 7.34.09 Latest: 7.33.03
echo $? echo $?
1 1
``` ```
@@ -76,7 +76,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
7.34.09 7.33.03
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@@ -86,13 +86,13 @@ 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.34.09 - https://github.com/GAM-team/GAM GAM 7.33.03 - https://github.com/GAM-team/GAM
GAM Team <google-apps-manager@googlegroups.com> GAM Team <google-apps-manager@googlegroups.com>
Python 3.14.3 64-bit final Python 3.14.2 64-bit final
macOS Tahoe 26.3 arm64 macOS Tahoe 26.2 x86_64
Path: /Users/gamteam/bin/gam7 Path: /Users/Admin/bin/gam7
Config File: /Users/gamteam/GamConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, customer_id: my_customer, domain: domain.com
Time: 2026-02-15T07:51:00-08:00 Time: 2025-12-23T13:57:00-08:00
Help: Syntax in file /Users/gamteam/bin/gam7/GamCommands.txt Help: Syntax in file /Users/Admin/bin/gam7/GamCommands.txt
Help: Documentation is at https://github.com/GAM-team/GAM/wiki Help: Documentation is at https://github.com/GAM-team/GAM/wiki
``` ```

View File

@@ -232,11 +232,6 @@ csv_output_header_order
Any headers in the file but not in the list will appear after Any headers in the file but not in the list will appear after
the headers in the list the headers in the list
Default: '' Default: ''
csv_output_header_required
A list of <Strings> used to specify column headers
for inclusion in the CSV file written by a gam print command
even if the API didn't return any data for those columns.
Default: ''
csv_output_line_terminator csv_output_line_terminator
Allowed values: cr, lf, crlf Allowed values: cr, lf, crlf
Designates character(s) used to terminate the lines of a CSV file. Designates character(s) used to terminate the lines of a CSV file.
@@ -735,8 +730,6 @@ Section: DEFAULT
csv_output_header_drop_filter = '' csv_output_header_drop_filter = ''
csv_output_header_filter = '' csv_output_header_filter = ''
csv_output_header_force = '' csv_output_header_force = ''
csv_output_header_order = ''
csv_output_header_required = ''
csv_output_line_terminator = lf csv_output_line_terminator = lf
csv_output_no_escape_char = false csv_output_no_escape_char = false
csv_output_quote_char = '"' csv_output_quote_char = '"'
@@ -983,7 +976,6 @@ csv_output_header_drop_filter = ''
csv_output_header_filter = '' csv_output_header_filter = ''
csv_output_header_force = '' csv_output_header_force = ''
csv_output_header_order = '' csv_output_header_order = ''
csv_output_header_required = ''
csv_output_line_terminator = lf csv_output_line_terminator = lf
csv_output_no_escape_char = false csv_output_no_escape_char = false
csv_output_quote_char = '"' csv_output_quote_char = '"'