mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-05 12:13:34 +00:00
Added option oneitemperrow
to 'gam print admins|adminroles`
This commit is contained in:
@ -851,11 +851,15 @@ gam delete adminrole <RoleItem>
|
|||||||
## Display administrative roles
|
## Display administrative roles
|
||||||
```
|
```
|
||||||
gam info adminrole <RoleItem> [privileges]
|
gam info adminrole <RoleItem> [privileges]
|
||||||
gam print adminroles|roles [todrive <ToDriveAttribute>*] [privileges]
|
gam print adminroles|roles [todrive <ToDriveAttribute>*]
|
||||||
|
[privileges] [oneitemperrow]
|
||||||
gam show adminroles|roles [todrive <ToDriveAttribute>*] [privileges]
|
gam show adminroles|roles [todrive <ToDriveAttribute>*] [privileges]
|
||||||
```
|
```
|
||||||
* `privileges` - Display privileges associated with each role
|
* `privileges` - Display privileges associated with each role
|
||||||
|
|
||||||
|
By default, all privileges for a role are shown on one row as a repeating item.
|
||||||
|
When `oneitemperrow` is specified, each privilege is output on a separate row/line with the other role fields.
|
||||||
|
|
||||||
## Create an administrator
|
## Create an administrator
|
||||||
Add an administrator role to an administrator.
|
Add an administrator role to an administrator.
|
||||||
```
|
```
|
||||||
@ -877,7 +881,8 @@ gam delete admin <RoleAssignmentId>
|
|||||||
## Display administrators
|
## Display administrators
|
||||||
```
|
```
|
||||||
gam print admins [todrive <ToDriveAttribute>*]
|
gam print admins [todrive <ToDriveAttribute>*]
|
||||||
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition]
|
||||||
|
[privileges] [oneitemperrow]
|
||||||
gam show admins
|
gam show admins
|
||||||
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
||||||
```
|
```
|
||||||
@ -889,6 +894,9 @@ options to limit the display:
|
|||||||
* `condition` - Display any conditions associated with a role assignment
|
* `condition` - Display any conditions associated with a role assignment
|
||||||
* `privileges` - Display privileges associated with each role assignment
|
* `privileges` - Display privileges associated with each role assignment
|
||||||
|
|
||||||
|
By default, all role privileges for an admin are shown on one row as a repeating item.
|
||||||
|
When `oneitemperrow` is specified, each role privilege is output on a separate row/line with the other admin fields.
|
||||||
|
|
||||||
In versions prior to 6.07.01, specification of both `user <UserItem>`
|
In versions prior to 6.07.01, specification of both `user <UserItem>`
|
||||||
and `role <RoleItem>` generated no output due to an undocumented API rule that disallows both.
|
and `role <RoleItem>` generated no output due to an undocumented API rule that disallows both.
|
||||||
|
|
||||||
|
@ -222,87 +222,6 @@
|
|||||||
shortcut
|
shortcut
|
||||||
<MimeTypeName> ::= application|audio|font|image|message|model|multipart|text|video
|
<MimeTypeName> ::= application|audio|font|image|message|model|multipart|text|video
|
||||||
<MimeType> ::= <MimeTypeShortcut>|(<MimeTypeName>/<String>)
|
<MimeType> ::= <MimeTypeShortcut>|(<MimeTypeName>/<String>)
|
||||||
<ProductID> ::=
|
|
||||||
nv:<String> |
|
|
||||||
101001 |
|
|
||||||
101005 |
|
|
||||||
101031 |
|
|
||||||
101033 |
|
|
||||||
101034 |
|
|
||||||
101035 |
|
|
||||||
101036 |
|
|
||||||
101037 |
|
|
||||||
101038 |
|
|
||||||
101039 |
|
|
||||||
101040 |
|
|
||||||
101043 |
|
|
||||||
101047 |
|
|
||||||
Google-Apps |
|
|
||||||
Google-Chrome-Device-Management |
|
|
||||||
Google-Drive-storage |
|
|
||||||
Google-Vault
|
|
||||||
<SKUID> ::=
|
|
||||||
nv:<String>:<String> |
|
|
||||||
20gb | drive20gb | googledrivestorage20gb | Google-Drive-storage-20GB |
|
|
||||||
50gb | drive50gb | googledrivestorage50gb | Google-Drive-storage-50GB |
|
|
||||||
200gb | drive200gb | googledrivestorage200gb | Google-Drive-storage-200GB |
|
|
||||||
400gb | drive400gb | googledrivestorage400gb | Google-Drive-storage-400GB |
|
|
||||||
1tb | drive1tb | googledrivestorage1tb | Google-Drive-storage-1TB |
|
|
||||||
2tb | drive2tb | googledrivestorage2tb | Google-Drive-storage-2TB |
|
|
||||||
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
|
|
||||||
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
|
|
||||||
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
|
|
||||||
appsheetcore | 1010380001 |
|
|
||||||
appsheetstandard | appsheetenterprisestandard | 1010380002 |
|
|
||||||
appsheetplus | appsheetenterpriseplus | 1010380003 |
|
|
||||||
assuredcontrols | 1010390001 |
|
|
||||||
bce | beyondcorp | beyondcorpenterprise | 1010400001 |
|
|
||||||
cdm | chrome | googlechromedevicemanagement | Google-Chrome-Device-Management |
|
|
||||||
cloudidentity | identity | 1010010001 |
|
|
||||||
cloudidentitypremium | identitypremium | 1010050001 |
|
|
||||||
cloudsearch | 1010350001 |
|
|
||||||
geminibiz | 1010470003 |
|
|
||||||
geminient| duetai | 1010470001 |
|
|
||||||
gsuitebasic | gafb | gafw | basic | Google-Apps-For-Business |
|
|
||||||
gsuitebusiness | gau | gsb | unlimited | Google-Apps-Unlimited |
|
|
||||||
gsuitebusinessarchived | gsbau | businessarchived | 1010340002 |
|
|
||||||
gsuiteenterprisearchived | gseau | enterprisearchived | 1010340001 |
|
|
||||||
gsuiteenterpriseeducation | gsefe | e4e | 1010310002 |
|
|
||||||
gsuiteenterpriseeducationstudent | gsefes | e4es | 1010310003 |
|
|
||||||
gsuitegov | gafg | gsuitegovernment | Google-Apps-For-Government |
|
|
||||||
gsuitelite | gal | gsl | lite | Google-Apps-Lite |
|
|
||||||
gwep | workspaceeducationplus | 1010310008 |
|
|
||||||
gwepstaff | workspaceeducationplusstaff | 1010310009 |
|
|
||||||
gwepstudent | workspaceeducationplusstudent | 1010310010 |
|
|
||||||
gwes | workspaceeducationstandard | 1010310005 |
|
|
||||||
gwesstaff | workspaceeducationstandardstaff | 1010310006 |
|
|
||||||
gwesstudent | workspaceeducationstandardstudent | 1010310007 |
|
|
||||||
gwetlu | workspaceeducationupgrade | 1010370001 |
|
|
||||||
gwlabs | workspacelabs | 1010470002
|
|
||||||
meetdialing | googlemeetglobaldialing | 1010360001 |
|
|
||||||
postini | gams | gsuitegams | gsuitepostini | gsuitemessagesecurity | Google-Apps-For-Postini |
|
|
||||||
standard | free | Google-Apps |
|
|
||||||
vault | googlevault | Google-Vault |
|
|
||||||
vfe | googlevaultformeremployee | Google-Vault-Former-Employee |
|
|
||||||
voicepremier | gvpremier | googlevoicepremier | 1010330002 |
|
|
||||||
voicestandard | gvstandard | googlevoicestandard | 1010330004 |
|
|
||||||
voicestarter | gvstarter | googlevoicestarter | 1010330003 |
|
|
||||||
wsas | plusstorage | 1010430001 |
|
|
||||||
wsbizplus | workspacebusinessplus | 1010020025 |
|
|
||||||
wsbizplusarchived | workspacebusinessplusarchived | 1010340003 |
|
|
||||||
wsbizstan | workspacebusinessstandard | 1010020028 |
|
|
||||||
wsbizstanarchived | workspacebusinessstandardarchived | 1010340006 |
|
|
||||||
wsbizstarter | workspacebusinessstarter | wsbizstart | 1010020027 |
|
|
||||||
wsbizstarterarchived | workspacebusinessstarterarchived | 1010340005 |
|
|
||||||
wsentess | workspaceenterpriseessentials | 1010060003 |
|
|
||||||
wsentplus | workspaceenterpriseplus | gae | gse | enterprise | gsuiteenterprise | 1010020020 |
|
|
||||||
wsentstan | workspaceenterprisestandard | 1010020026 |
|
|
||||||
wsentstanarchived | workspaceenterprisestandardarchived | 1010340004 |
|
|
||||||
wsentstarter | workspaceenterprisestarter | 1010020029 | wes |
|
|
||||||
wsess | workspaceesentials | gsuiteessentials | essentials | d4e | driveenterprise | drive4enterprise | 1010060001 |
|
|
||||||
wsessplus | workspaceessentialsplus | 1010060005 |
|
|
||||||
wsflw | workspacefrontline | workspacefrontlineworker | 1010020030 |
|
|
||||||
wsflwstan | workspacefrontlinestan | workspacefrontlineworkerstan | 1010020031
|
|
||||||
```
|
```
|
||||||
## Items built from primitives
|
## Items built from primitives
|
||||||
```
|
```
|
||||||
|
@ -10,6 +10,18 @@ Add the `-s` option to the end of the above commands to suppress creating the `g
|
|||||||
|
|
||||||
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 6.71.08
|
||||||
|
|
||||||
|
Added option `oneitemperrow` to 'gam print admins|adminroles` to have each of a
|
||||||
|
roles privileges displayed on a separate row with all of the other admin/role fields.
|
||||||
|
This produces a CSV file that can be used in subsequent commands without further script processing.
|
||||||
|
|
||||||
|
### 6.71.07
|
||||||
|
|
||||||
|
Added command to upload changes to Google Docs.
|
||||||
|
|
||||||
|
* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files-Manage#upload-changes-to-google-documents
|
||||||
|
|
||||||
### 6.71.06
|
### 6.71.06
|
||||||
|
|
||||||
Added additional error handling to Gmail Client Side Encryption commands.
|
Added additional error handling to Gmail Client Side Encryption commands.
|
||||||
|
@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version
|
||||||
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.71.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -1006,7 +1006,7 @@ writes the credentials into the file oauth2.txt.
|
|||||||
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt
|
||||||
C:\GAMADV-XTD3>gam version
|
C:\GAMADV-XTD3>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
|
||||||
GAMADV-XTD3 6.71.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
@ -118,6 +118,7 @@
|
|||||||
101040 |
|
101040 |
|
||||||
101043 |
|
101043 |
|
||||||
101047 |
|
101047 |
|
||||||
|
101049 |
|
||||||
Google-Apps |
|
Google-Apps |
|
||||||
Google-Chrome-Device-Management |
|
Google-Chrome-Device-Management |
|
||||||
Google-Drive-storage |
|
Google-Drive-storage |
|
||||||
@ -135,52 +136,58 @@
|
|||||||
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
|
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
|
||||||
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
|
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
|
||||||
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
|
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
|
||||||
appsheetcore | 1010380001 |
|
appsheetcore | 1010380001 | AppSheet Core |
|
||||||
appsheetstandard | appsheetenterprisestandard | 1010380002 |
|
appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard |
|
||||||
appsheetplus | appsheetenterpriseplus | 1010380003 |
|
appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus |
|
||||||
assuredcontrols | 1010390001 |
|
assuredcontrols | 1010390001 | Assured Controls |
|
||||||
bce | beyondcorp | beyondcorpenterprise | 1010400001 |
|
bce | beyondcorp | beyondcorpenterprise | 1010400001 | Beyond Corp Enterprise |
|
||||||
cdm | chrome | googlechromedevicemanagement | Google-Chrome-Device-Management |
|
cdm | chrome | googlechromedevicemanagement | Google-Chrome-Device-Management |
|
||||||
cloudidentity | identity | 1010010001 |
|
cloudidentity | identity | 1010010001 | Cloud Identity |
|
||||||
cloudidentitypremium | identitypremium | 1010050001 |
|
cloudidentitypremium | identitypremium | 1010050001 | Cloud Identity Premium |
|
||||||
cloudsearch | 1010350001 |
|
cloudsearch | 1010350001 | Cloud Search |
|
||||||
duetai | 1010470001 |
|
eeu | 1010490001 | SKU Endpoint Education Upgrade |
|
||||||
|
geminibiz | 1010470003 | Gemini Business |
|
||||||
|
geminient| duetai | 1010470001 | Gemini Enterprise |
|
||||||
gsuitebasic | gafb | gafw | basic | Google-Apps-For-Business |
|
gsuitebasic | gafb | gafw | basic | Google-Apps-For-Business |
|
||||||
gsuitebusiness | gau | gsb | unlimited | Google-Apps-Unlimited |
|
gsuitebusiness | gau | gsb | unlimited | Google-Apps-Unlimited |
|
||||||
gsuitebusinessarchived | gsbau | businessarchived | 1010340002 |
|
gsuitebusinessarchived | gsbau | businessarchived | 1010340002 | Google Workspace Business - Archived User |
|
||||||
gsuiteenterprisearchived | gseau | enterprisearchived | 1010340001 |
|
gsuiteenterprisearchived | gseau | enterprisearchived | 1010340001 | Google Workspace Enterprise Plus - Archived User |
|
||||||
gsuiteenterpriseeducation | gsefe | e4e | 1010310002 |
|
gsuiteenterpriseeducation | gsefe | e4e | 1010310002 | Google Workspace for Education Plus - Legacy |
|
||||||
gsuiteenterpriseeducationstudent | gsefes | e4es | 1010310003 |
|
gsuiteenterpriseeducationstudent | gsefes | e4es | 1010310003 | Google Workspace for Education Plus - Legacy (Student) |
|
||||||
gsuitegov | gafg | gsuitegovernment | Google-Apps-For-Government |
|
gsuitegov | gafg | gsuitegovernment | Google-Apps-For-Government |
|
||||||
gsuitelite | gal | gsl | lite | Google-Apps-Lite |
|
gsuitelite | gal | gsl | lite | Google-Apps-Lite |
|
||||||
gwep | workspaceeducationplus | 1010310008 |
|
gwep | workspaceeducationplus | 1010310008 | Google Workspace for Education Plus |
|
||||||
gwepstaff | workspaceeducationplusstaff | 1010310009 |
|
gwepstaff | workspaceeducationplusstaff | 1010310009 | Google Workspace for Education Plus (Staff) |
|
||||||
gwepstudent | workspaceeducationplusstudent | 1010310010 |
|
gwepstudent | workspaceeducationplusstudent | 1010310010 | Google Workspace for Education Plus (Extra Student)|
|
||||||
gwes | workspaceeducationstandard | 1010310005 |
|
gwes | workspaceeducationstandard | 1010310005 | Google Workspace for Education Standard |
|
||||||
gwesstaff | workspaceeducationstandardstaff | 1010310006 |
|
gwesstaff | workspaceeducationstandardstaff | 1010310006 | Google Workspace for Education Standard (Staff) |
|
||||||
gwesstudent | workspaceeducationstandardstudent | 1010310007 |
|
gwesstudent | workspaceeducationstandardstudent | 1010310007 | Google Workspace for Education Standard (Extra Student)
|
||||||
gwetlu | workspaceeducationupgrade | 1010370001 |
|
gwetlu | workspaceeducationupgrade | 1010370001 | Google Workspace for Education: Teaching and Learning Upgrade |
|
||||||
gwlabs | workspacelabs | 1010470002
|
gwlabs | workspacelabs | 1010470002 | Google Workspace Labs |
|
||||||
meetdialing | googlemeetglobaldialing | 1010360001 |
|
meetdialing | googlemeetglobaldialing | 1010360001 | Google Meet Global Dialing |
|
||||||
postini | gams | gsuitegams | gsuitepostini | gsuitemessagesecurity | Google-Apps-For-Postini |
|
postini | gams | gsuitegams | gsuitepostini | gsuitemessagesecurity | Google-Apps-For-Postini |
|
||||||
standard | free | Google-Apps |
|
standard | free | Google-Apps |
|
||||||
vault | googlevault | Google-Vault |
|
vault | googlevault | Google-Vault |
|
||||||
vfe | googlevaultformeremployee | Google-Vault-Former-Employee |
|
vfe | googlevaultformeremployee | Google-Vault-Former-Employee |
|
||||||
voicepremier | gvpremier | googlevoicepremier | 1010330002 |
|
voicepremier | gvpremier | googlevoicepremier | 1010330002 | Google Voice Premier
|
||||||
voicestandard | gvstandard | googlevoicestandard | 1010330004 |
|
voicestandard | gvstandard | googlevoicestandard | 1010330004 | Google Voice Standard |
|
||||||
voicestarter | gvstarter | googlevoicestarter | 1010330003 |
|
voicestarter | gvstarter | googlevoicestarter | 1010330003 | Google Voice Starter |
|
||||||
wsas | plusstorage | 1010430001 |
|
wsas | plusstorage | 1010430001 | Google Workspace Additional Storage |
|
||||||
wsbizplus | workspacebusinessplus | 1010020025 |
|
wsbizplus | workspacebusinessplus | 1010020025 | Google Workspace Business Plus |
|
||||||
wsbizplusarchived | workspacebusinessplusarchived | 1010340003 |
|
wsbizplusarchived | workspacebusinessplusarchived | 1010340003 | Google Workspace Business Plus - Archived User |
|
||||||
wsbizstan | workspacebusinessstandard | 1010020028 |
|
wsbizstan | workspacebusinessstandard | 1010020028 | Google Workspace Business Standard }
|
||||||
wsbizstarter | workspacebusinessstarter | wsbizstart | 1010020027 |
|
wsbizstanarchived | workspacebusinessstandardarchived | 1010340006 | Google Workspace Business Standard - Archived User |
|
||||||
wsentess | workspaceenterpriseessentials | 1010060003 |
|
wsbizstarter | workspacebusinessstarter | wsbizstart | 1010020027 | Google Workspace Business Starter |
|
||||||
wsentplus | workspaceenterpriseplus | gae | gse | enterprise | gsuiteenterprise | 1010020020 |
|
wsbizstarterarchived | workspacebusinessstarterarchived | 1010340005 | Google Workspace Business Starter - Archived User |
|
||||||
wsentstan | workspaceenterprisestandard | 1010020026 |
|
wsentess | workspaceenterpriseessentials | 1010060003 | Google Workspace Enterprise Essentials |
|
||||||
wsentstanarchived | workspaceenterprisestandardarchived | 1010340004 |
|
wsentplus | workspaceenterpriseplus | gae | gse | enterprise | gsuiteenterprise | 1010020020 | Google Workspace Enterprise Plus |
|
||||||
wsentstarter | workspaceenterprisestarter | 1010020029 | wes |
|
wsentstan | workspaceenterprisestandard | 1010020026 | Google Workspace Enterprise Standard |
|
||||||
wsess | workspaceesentials | gsuiteessentials | essentials | d4e | driveenterprise | drive4enterprise | 1010060001 |
|
wsentstanarchived | workspaceenterprisestandardarchived | 1010340004 | Google Workspace Enterprise Standard - Archived User |
|
||||||
wsflw | workspacefrontline | workspacefrontlineworker | 1010020030
|
wsentstarter | workspaceenterprisestarter | wes | 1010020029 | Workspace Enterprise Starter |
|
||||||
|
wsess | workspaceesentials | gsuiteessentials | essentials | d4e | driveenterprise | drive4enterprise | 1010060001 | Google Workspace Essentials |
|
||||||
|
wsessplus | workspaceessentialsplus | 1010060005 | Google Workspace Essentials Plus |
|
||||||
|
wsflw | workspacefrontline | workspacefrontlineworker | 1010020030 | Google Workspace Frontline Starter |
|
||||||
|
wsflwstan | workspacefrontlinestan | workspacefrontlineworkerstan | 1010020031 | Google Workspace Frontline Standard
|
||||||
<SKUIDList> ::= "<SKUID>(,<SKUID>)*"
|
<SKUIDList> ::= "<SKUID>(,<SKUID>)*"
|
||||||
```
|
```
|
||||||
## Notes
|
## Notes
|
||||||
|
@ -59,46 +59,58 @@ Thanks to Duncan Isaksen-Loxton for a script to help manage multiple domains.
|
|||||||
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
|
4tb | drive4tb | googledrivestorage4tb | Google-Drive-storage-4TB |
|
||||||
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
|
8tb | drive8tb | googledrivestorage8tb | Google-Drive-storage-8TB |
|
||||||
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
|
16tb | drive16tb | googledrivestorage16tb | Google-Drive-storage-16TB |
|
||||||
assuredcontrols | 1010390001 |
|
appsheetcore | 1010380001 | AppSheet Core |
|
||||||
bce | beyondcorp | beyondcorpenterprise | 1010400001 |
|
appsheetstandard | appsheetenterprisestandard | 1010380002 | AppSheet Enterprise Standard |
|
||||||
|
appsheetplus | appsheetenterpriseplus | 1010380003 | AppSheet Enterprise Plus |
|
||||||
|
assuredcontrols | 1010390001 | Assured Controls |
|
||||||
|
bce | beyondcorp | beyondcorpenterprise | 1010400001 | Beyond Corp Enterprise |
|
||||||
cdm | chrome | googlechromedevicemanagement | Google-Chrome-Device-Management |
|
cdm | chrome | googlechromedevicemanagement | Google-Chrome-Device-Management |
|
||||||
cloudidentity | identity | 1010010001 |
|
cloudidentity | identity | 1010010001 | Cloud Identity |
|
||||||
cloudidentitypremium | identitypremium | 1010050001 |
|
cloudidentitypremium | identitypremium | 1010050001 | Cloud Identity Premium |
|
||||||
cloudsearch | 1010350001 |
|
cloudsearch | 1010350001 | Cloud Search |
|
||||||
|
eeu | 1010490001 | SKU Endpoint Education Upgrade |
|
||||||
|
geminibiz | 1010470003 | Gemini Business |
|
||||||
|
geminient| duetai | 1010470001 | Gemini Enterprise |
|
||||||
gsuitebasic | gafb | gafw | basic | Google-Apps-For-Business |
|
gsuitebasic | gafb | gafw | basic | Google-Apps-For-Business |
|
||||||
gsuitebusiness | gau | gsb | unlimited | Google-Apps-Unlimited |
|
gsuitebusiness | gau | gsb | unlimited | Google-Apps-Unlimited |
|
||||||
gsuitebusinessarchived | gsbau | businessarchived | 1010340002 |
|
gsuitebusinessarchived | gsbau | businessarchived | 1010340002 | Google Workspace Business - Archived User |
|
||||||
gsuiteenterprisearchived | gseau | enterprisearchived | 1010340001 |
|
gsuiteenterprisearchived | gseau | enterprisearchived | 1010340001 | Google Workspace Enterprise Plus - Archived User |
|
||||||
gsuiteenterpriseeducation | gsefe | e4e | 1010310002 |
|
gsuiteenterpriseeducation | gsefe | e4e | 1010310002 | Google Workspace for Education Plus - Legacy |
|
||||||
gsuiteenterpriseeducationstudent | gsefes | e4es | 1010310003 |
|
gsuiteenterpriseeducationstudent | gsefes | e4es | 1010310003 | Google Workspace for Education Plus - Legacy (Student) |
|
||||||
gsuitegov | gafg | gsuitegovernment | Google-Apps-For-Government |
|
gsuitegov | gafg | gsuitegovernment | Google-Apps-For-Government |
|
||||||
gsuitelite | gal | gsl | lite | Google-Apps-Lite |
|
gsuitelite | gal | gsl | lite | Google-Apps-Lite |
|
||||||
gwep | workspaceeducationplus | 1010310008 |
|
gwep | workspaceeducationplus | 1010310008 | Google Workspace for Education Plus |
|
||||||
gwepstaff | workspaceeducationplusstaff | 1010310009 |
|
gwepstaff | workspaceeducationplusstaff | 1010310009 | Google Workspace for Education Plus (Staff) |
|
||||||
gwepstudent | workspaceeducationplusstudent | 1010310010 |
|
gwepstudent | workspaceeducationplusstudent | 1010310010 | Google Workspace for Education Plus (Extra Student)|
|
||||||
gwes | workspaceeducationstandard | 1010310005 |
|
gwes | workspaceeducationstandard | 1010310005 | Google Workspace for Education Standard |
|
||||||
gwesstaff | workspaceeducationstandardstaff | 1010310006 |
|
gwesstaff | workspaceeducationstandardstaff | 1010310006 | Google Workspace for Education Standard (Staff) |
|
||||||
gwesstudent | workspaceeducationstandardstudent | 1010310007 |
|
gwesstudent | workspaceeducationstandardstudent | 1010310007 | Google Workspace for Education Standard (Extra Student)
|
||||||
gwetlu | workspaceeducationupgrade | 1010370001 |
|
gwetlu | workspaceeducationupgrade | 1010370001 | Google Workspace for Education: Teaching and Learning Upgrade |
|
||||||
meetdialing | googlemeetglobaldialing | 1010360001 |
|
gwlabs | workspacelabs | 1010470002 | Google Workspace Labs |
|
||||||
|
meetdialing | googlemeetglobaldialing | 1010360001 | Google Meet Global Dialing |
|
||||||
postini | gams | gsuitegams | gsuitepostini | gsuitemessagesecurity | Google-Apps-For-Postini |
|
postini | gams | gsuitegams | gsuitepostini | gsuitemessagesecurity | Google-Apps-For-Postini |
|
||||||
standard | free | Google-Apps |
|
standard | free | Google-Apps |
|
||||||
vault | googlevault | Google-Vault |
|
vault | googlevault | Google-Vault |
|
||||||
vfe | googlevaultformeremployee | Google-Vault-Former-Employee |
|
vfe | googlevaultformeremployee | Google-Vault-Former-Employee |
|
||||||
voicepremier | gvpremier | googlevoicepremier | 1010330002 |
|
voicepremier | gvpremier | googlevoicepremier | 1010330002 | Google Voice Premier
|
||||||
voicestandard | gvstandard | googlevoicestandard | 1010330004 |
|
voicestandard | gvstandard | googlevoicestandard | 1010330004 | Google Voice Standard |
|
||||||
voicestarter | gvstarter | googlevoicestarter | 1010330003 |
|
voicestarter | gvstarter | googlevoicestarter | 1010330003 | Google Voice Starter |
|
||||||
wsbizplus | workspacebusinessplus | 1010020025 |
|
wsas | plusstorage | 1010430001 | Google Workspace Additional Storage |
|
||||||
wsbizplusarchived | workspacebusinessplusarchived | 1010340003 |
|
wsbizplus | workspacebusinessplus | 1010020025 | Google Workspace Business Plus |
|
||||||
wsbizstan | workspacebusinessstandard | 1010020028 |
|
wsbizplusarchived | workspacebusinessplusarchived | 1010340003 | Google Workspace Business Plus - Archived User |
|
||||||
wsbizstarter | workspacebusinessstarter | wsbizstart | 1010020027 |
|
wsbizstan | workspacebusinessstandard | 1010020028 | Google Workspace Business Standard }
|
||||||
wsentess | workspaceenterpriseessentials | 1010060003 |
|
wsbizstanarchived | workspacebusinessstandardarchived | 1010340006 | Google Workspace Business Standard - Archived User |
|
||||||
wsentplus | workspaceenterpriseplus | gae | gse | enterprise | gsuiteenterprise | 1010020020 |
|
wsbizstarter | workspacebusinessstarter | wsbizstart | 1010020027 | Google Workspace Business Starter |
|
||||||
wsentstan | workspaceenterprisestandard | 1010020026 |
|
wsbizstarterarchived | workspacebusinessstarterarchived | 1010340005 | Google Workspace Business Starter - Archived User |
|
||||||
wsentstanarchived | workspaceenterprisestandardarchived | 1010340004 |
|
wsentess | workspaceenterpriseessentials | 1010060003 | Google Workspace Enterprise Essentials |
|
||||||
wsentstarter | workspaceenterprisestarter | 1010020029 | wes |
|
wsentplus | workspaceenterpriseplus | gae | gse | enterprise | gsuiteenterprise | 1010020020 | Google Workspace Enterprise Plus |
|
||||||
wsess | workspaceesentials | gsuiteessentials | essentials | d4e | driveenterprise | drive4enterprise | 1010060001 |
|
wsentstan | workspaceenterprisestandard | 1010020026 | Google Workspace Enterprise Standard |
|
||||||
wsflw | workspacefrontline | workspacefrontlineworker | 1010020030
|
wsentstanarchived | workspaceenterprisestandardarchived | 1010340004 | Google Workspace Enterprise Standard - Archived User |
|
||||||
|
wsentstarter | workspaceenterprisestarter | wes | 1010020029 | Workspace Enterprise Starter |
|
||||||
|
wsess | workspaceesentials | gsuiteessentials | essentials | d4e | driveenterprise | drive4enterprise | 1010060001 | Google Workspace Essentials |
|
||||||
|
wsessplus | workspaceessentialsplus | 1010060005 | Google Workspace Essentials Plus |
|
||||||
|
wsflw | workspacefrontline | workspacefrontlineworker | 1010020030 | Google Workspace Frontline Starter |
|
||||||
|
wsflwstan | workspacefrontlinestan | workspacefrontlineworkerstan | 1010020031 | Google Workspace Frontline Standard
|
||||||
```
|
```
|
||||||
## Manage Resold Customers
|
## Manage Resold Customers
|
||||||
```
|
```
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
- [Shortcuts](Users-Drive-Shortcuts)
|
- [Shortcuts](Users-Drive-Shortcuts)
|
||||||
- [Drive Labels](Users-Drive-Labels)
|
- [Drive Labels](Users-Drive-Labels)
|
||||||
- [Download Google Documents as JSON](#download-google-documents-as-json)
|
- [Download Google Documents as JSON](#download-google-documents-as-json)
|
||||||
|
- [Upload changes to Google Documents](#upload-changes-to-google-documents)
|
||||||
|
|
||||||
## API documentation
|
## API documentation
|
||||||
* https://developers.google.com/drive/api/v3/reference/files
|
* https://developers.google.com/drive/api/v3/reference/files
|
||||||
@ -642,8 +643,6 @@ gam <UserTypeEntity> delete|del drivefile <DriveFileEntity> purge
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Download Google Documents as JSON
|
## Download Google Documents as JSON
|
||||||
This command was added in version 5.31.04, you'll have to do `gam update project` and
|
|
||||||
`gam <UserTypeEntity> check|update serviceaccount` to enable it.
|
|
||||||
```
|
```
|
||||||
gam <UserTypeEntity> get document <DriveFileEntity>
|
gam <UserTypeEntity> get document <DriveFileEntity>
|
||||||
[viewmode default|suggestions_inline|preview_suggestions_accepted|preview_without_suggestions]
|
[viewmode default|suggestions_inline|preview_suggestions_accepted|preview_without_suggestions]
|
||||||
@ -666,3 +665,31 @@ By default, when getting a document, an existing local file will not be overwrit
|
|||||||
* `overwrite` - Overwite an existing file
|
* `overwrite` - Overwite an existing file
|
||||||
* `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
|
||||||
|
|
||||||
|
## Upload changes to Google Documents
|
||||||
|
|
||||||
|
```
|
||||||
|
<DocumentJSONUpdateRequest> ::=
|
||||||
|
'{"requests": [{object (Request)}], "writeControl": {object (WriteControl) }`
|
||||||
|
See: https://developers.google.com/docs/api/reference/rest/v1/documents/request
|
||||||
|
|
||||||
|
gam <UserTypeEntity> update document <DriveFileEntity>
|
||||||
|
((json [charset <Charset>] <DocumentJSONUpdateRequest>) |
|
||||||
|
(json file <FileName> [charset <Charset>]))
|
||||||
|
[formatjson]
|
||||||
|
```
|
||||||
|
The JSON data can be read from a command line argument or a file. On the command line, the
|
||||||
|
JSON data is enclosed in single quotes; these should not be present when the JSON data is read from a file.
|
||||||
|
|
||||||
|
The output is formatted for human readability. Use the following option to produce JSON output for program parsing.
|
||||||
|
* `formatjson` - Display output in JSON format.
|
||||||
|
|
||||||
|
### Examples
|
||||||
|
Replace Foo with Goo in a document.
|
||||||
|
```
|
||||||
|
File Update.json contains:
|
||||||
|
{ "requests": [{"replaceAllText": {"replaceText": "Goo", "containsText": {"text": "Foo", "matchCase": "True"}}}]}
|
||||||
|
|
||||||
|
|
||||||
|
gam user testuser@domain.com update document <DriveFileItem> json file Update.json
|
||||||
|
```
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAMADV-XTD3 6.71.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00
|
|||||||
Print the current version of Gam with details and time offset information
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAMADV-XTD3 6.71.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second
|
|||||||
Print the current version of Gam with extended details and SSL information
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAMADV-XTD3 6.71.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.71.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64
|
|||||||
Path: /Users/Admin/bin/gamadv-xtd3
|
Path: /Users/Admin/bin/gamadv-xtd3
|
||||||
Version Check:
|
Version Check:
|
||||||
Current: 5.35.08
|
Current: 5.35.08
|
||||||
Latest: 6.71.06
|
Latest: 6.71.08
|
||||||
echo $?
|
echo $?
|
||||||
1
|
1
|
||||||
```
|
```
|
||||||
@ -72,7 +72,7 @@ echo $?
|
|||||||
Print the current version number without details
|
Print the current version number without details
|
||||||
```
|
```
|
||||||
gam version simple
|
gam version simple
|
||||||
6.71.06
|
6.71.08
|
||||||
```
|
```
|
||||||
In Linux/MacOS you can do:
|
In Linux/MacOS you can do:
|
||||||
```
|
```
|
||||||
@ -82,7 +82,7 @@ echo $VER
|
|||||||
Print the current version of Gam and address of this Wiki
|
Print the current version of Gam and address of this Wiki
|
||||||
```
|
```
|
||||||
gam help
|
gam help
|
||||||
GAM 6.71.06 - https://github.com/taers232c/GAMADV-XTD3
|
GAM 6.71.08 - https://github.com/taers232c/GAMADV-XTD3
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.2 64-bit final
|
Python 3.12.2 64-bit final
|
||||||
MacOS Sonoma 14.2.1 x86_64
|
MacOS Sonoma 14.2.1 x86_64
|
||||||
|
@ -1438,7 +1438,8 @@ gam create adminrole <String> privileges all|all_ou|<PrivilegesList> [descriptio
|
|||||||
gam update adminrole <RoleItem> [name <String>] [privileges all|all_ou|<PrivilegesList>] [description <String>]
|
gam update adminrole <RoleItem> [name <String>] [privileges all|all_ou|<PrivilegesList>] [description <String>]
|
||||||
gam delete adminrole <RoleItem>
|
gam delete adminrole <RoleItem>
|
||||||
gam info adminrole <RoleItem> [privileges]
|
gam info adminrole <RoleItem> [privileges]
|
||||||
gam print adminroles|roles [todrive <ToDriveAttribute>*] [privileges]
|
gam print adminroles|roles [todrive <ToDriveAttribute>*]
|
||||||
|
[privileges] [oneitemperrow]
|
||||||
gam show adminroles|roles [privileges]
|
gam show adminroles|roles [privileges]
|
||||||
|
|
||||||
gam create|add admin <EmailAddress>|<UniqueID> <RoleItem> customer|(org_unit <OrgUnitItem>)
|
gam create|add admin <EmailAddress>|<UniqueID> <RoleItem> customer|(org_unit <OrgUnitItem>)
|
||||||
@ -1446,7 +1447,8 @@ gam create|add admin <EmailAddress>|<UniqueID> <RoleItem> customer|(org_unit <Or
|
|||||||
gam delete admin <RoleAssignmentId>
|
gam delete admin <RoleAssignmentId>
|
||||||
|
|
||||||
gam print admins [todrive <ToDriveAttribute>*]
|
gam print admins [todrive <ToDriveAttribute>*]
|
||||||
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition]
|
||||||
|
[privileges] [oneitemperrow]
|
||||||
gam show admins
|
gam show admins
|
||||||
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
[user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
||||||
|
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
|
|
||||||
Merged GAM-Team version
|
Merged GAM-Team version
|
||||||
|
|
||||||
|
6.71.08
|
||||||
|
|
||||||
|
Added option `oneitemperrow` to 'gam print admins|adminroles` to have each of a
|
||||||
|
roles privileges displayed on a separate row with all of the other admin/role fields.
|
||||||
|
This produces a CSV file that can be used in subsequent commands without further script processing.
|
||||||
|
|
||||||
6.71.07
|
6.71.07
|
||||||
|
|
||||||
Added command to upload changes to Google Docs.
|
Added command to upload changes to Google Docs.
|
||||||
|
@ -8365,7 +8365,7 @@ class CSVPrintFile():
|
|||||||
else:
|
else:
|
||||||
def g(obj):
|
def g(obj):
|
||||||
return tuple(obj.get(item, '') for item in items)
|
return tuple(obj.get(item, '') for item in items)
|
||||||
return g
|
return g
|
||||||
|
|
||||||
def writeCSVData(writer):
|
def writeCSVData(writer):
|
||||||
try:
|
try:
|
||||||
@ -16137,23 +16137,29 @@ def doInfoAdminRole():
|
|||||||
except (GAPI.badRequest, GAPI.customerNotFound):
|
except (GAPI.badRequest, GAPI.customerNotFound):
|
||||||
accessErrorExit(cd)
|
accessErrorExit(cd)
|
||||||
|
|
||||||
# gam print adminroles|roles [todrive <ToDriveAttribute>*] [privileges]
|
# gam print adminroles|roles [todrive <ToDriveAttribute>*]
|
||||||
|
# [privileges] [oneitemperrow]
|
||||||
# gam show adminroles|roles [privileges]
|
# gam show adminroles|roles [privileges]
|
||||||
def doPrintShowAdminRoles():
|
def doPrintShowAdminRoles():
|
||||||
cd = buildGAPIObject(API.DIRECTORY)
|
cd = buildGAPIObject(API.DIRECTORY)
|
||||||
fieldsList = PRINT_ADMIN_ROLES_FIELDS[:]
|
fieldsList = PRINT_ADMIN_ROLES_FIELDS[:]
|
||||||
csvPF = CSVPrintFile(fieldsList, PRINT_ADMIN_ROLES_FIELDS) if Act.csvFormat() else None
|
csvPF = CSVPrintFile(fieldsList, PRINT_ADMIN_ROLES_FIELDS) if Act.csvFormat() else None
|
||||||
|
oneItemPerRow = False
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
if csvPF and myarg == 'todrive':
|
if csvPF and myarg == 'todrive':
|
||||||
csvPF.GetTodriveParameters()
|
csvPF.GetTodriveParameters()
|
||||||
elif myarg == 'privileges':
|
elif myarg == 'privileges':
|
||||||
if csvPF:
|
fieldsList.append('rolePrivileges')
|
||||||
csvPF.AddField(myarg, {myarg: 'rolePrivileges'}, fieldsList)
|
elif myarg == 'oneitemperrow':
|
||||||
else:
|
oneItemPerRow = True
|
||||||
fieldsList.append('rolePrivileges')
|
|
||||||
else:
|
else:
|
||||||
unknownArgumentExit()
|
unknownArgumentExit()
|
||||||
|
if csvPF:
|
||||||
|
if not oneItemPerRow:
|
||||||
|
csvPF.AddTitles(['rolePrivileges'])
|
||||||
|
else:
|
||||||
|
csvPF.AddTitles(['privilegeName', 'serviceId'])
|
||||||
fields = getItemFieldsFromFieldsList('items', fieldsList)
|
fields = getItemFieldsFromFieldsList('items', fieldsList)
|
||||||
printGettingAllAccountEntities(Ent.ADMIN_ROLE)
|
printGettingAllAccountEntities(Ent.ADMIN_ROLE)
|
||||||
try:
|
try:
|
||||||
@ -16177,7 +16183,14 @@ def doPrintShowAdminRoles():
|
|||||||
Ind.Decrement()
|
Ind.Decrement()
|
||||||
else:
|
else:
|
||||||
for role in roles:
|
for role in roles:
|
||||||
csvPF.WriteRowTitles(flattenJSON(role))
|
if not oneItemPerRow or 'rolePrivileges' not in role:
|
||||||
|
csvPF.WriteRowTitles(flattenJSON(role))
|
||||||
|
else:
|
||||||
|
privileges = role.pop('rolePrivileges')
|
||||||
|
baserow = flattenJSON(role)
|
||||||
|
for privilege in privileges:
|
||||||
|
row = flattenJSON(privilege, flattened=baserow.copy())
|
||||||
|
csvPF.WriteRowTitles(row)
|
||||||
if csvPF:
|
if csvPF:
|
||||||
csvPF.writeCSVfile('Admin Roles')
|
csvPF.writeCSVfile('Admin Roles')
|
||||||
|
|
||||||
@ -16262,21 +16275,25 @@ PRINT_ADMIN_FIELDS = ['roleAssignmentId', 'roleId', 'assignedTo', 'scopeType', '
|
|||||||
PRINT_ADMIN_TITLES = ['roleAssignmentId', 'roleId', 'role', 'assignedTo', 'assignedToUser', 'assignedToGroup', 'scopeType', 'orgUnitId', 'orgUnit']
|
PRINT_ADMIN_TITLES = ['roleAssignmentId', 'roleId', 'role', 'assignedTo', 'assignedToUser', 'assignedToGroup', 'scopeType', 'orgUnitId', 'orgUnit']
|
||||||
|
|
||||||
# gam print admins [todrive <ToDriveAttribute>*]
|
# gam print admins [todrive <ToDriveAttribute>*]
|
||||||
# [user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
# [user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition]
|
||||||
|
# [privileges] [oneitemperrow]
|
||||||
# gam show admins
|
# gam show admins
|
||||||
# [user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
# [user|group <EmailAddress>|<UniqueID>] [role <RoleItem>] [condition] [privileges]
|
||||||
def doPrintShowAdmins():
|
def doPrintShowAdmins():
|
||||||
def _getPrivileges(admin):
|
def _getPrivileges(admin):
|
||||||
if showPrivileges:
|
if showPrivileges:
|
||||||
try:
|
roleId = admin['roleId']
|
||||||
return callGAPI(cd.roles(), 'get',
|
if roleId not in rolePrivileges:
|
||||||
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND],
|
try:
|
||||||
customer=GC.Values[GC.CUSTOMER_ID], roleId=admin['roleId'], fields='rolePrivileges')
|
rolePrivileges[roleId] = callGAPI(cd.roles(), 'get',
|
||||||
except (GAPI.notFound, GAPI.forbidden) as e:
|
throwReasons=[GAPI.BAD_REQUEST, GAPI.CUSTOMER_NOT_FOUND, GAPI.FORBIDDEN]+[GAPI.NOT_FOUND],
|
||||||
entityActionFailedExit([Ent.USER, userKey, Ent.ADMIN_ROLE, admin['roleId']], str(e))
|
customer=GC.Values[GC.CUSTOMER_ID], roleId=roleId, fields='rolePrivileges')
|
||||||
except (GAPI.badRequest, GAPI.customerNotFound):
|
except (GAPI.notFound, GAPI.forbidden) as e:
|
||||||
accessErrorExit(cd)
|
entityActionFailedExit([Ent.USER, userKey, Ent.ADMIN_ROLE, admin['roleId']], str(e))
|
||||||
return None
|
rolePrivileges[roleId] = None
|
||||||
|
except (GAPI.badRequest, GAPI.customerNotFound):
|
||||||
|
accessErrorExit(cd)
|
||||||
|
return rolePrivileges[roleId]
|
||||||
|
|
||||||
def _setNamesFromIds(admin, privileges):
|
def _setNamesFromIds(admin, privileges):
|
||||||
admin['role'] = role_from_roleid(admin['roleId'])
|
admin['role'] = role_from_roleid(admin['roleId'])
|
||||||
@ -16300,7 +16317,7 @@ def doPrintShowAdmins():
|
|||||||
if assignedToField:
|
if assignedToField:
|
||||||
admin[assignedToField] = assignedToIdEmailMap[assignedTo]['assigneeEmail']
|
admin[assignedToField] = assignedToIdEmailMap[assignedTo]['assigneeEmail']
|
||||||
if privileges is not None:
|
if privileges is not None:
|
||||||
admin['rolePrivileges'] = privileges
|
admin.update(privileges)
|
||||||
if 'orgUnitId' in admin:
|
if 'orgUnitId' in admin:
|
||||||
admin['orgUnit'] = convertOrgUnitIDtoPath(cd, f'id:{admin["orgUnitId"]}')
|
admin['orgUnit'] = convertOrgUnitIDtoPath(cd, f'id:{admin["orgUnitId"]}')
|
||||||
if 'condition' in admin:
|
if 'condition' in admin:
|
||||||
@ -16310,11 +16327,12 @@ def doPrintShowAdmins():
|
|||||||
admin['condition'] = 'nonsecuritygroup'
|
admin['condition'] = 'nonsecuritygroup'
|
||||||
|
|
||||||
cd = buildGAPIObject(API.DIRECTORY)
|
cd = buildGAPIObject(API.DIRECTORY)
|
||||||
csvPF = CSVPrintFile() if Act.csvFormat() else None
|
csvPF = CSVPrintFile(PRINT_ADMIN_TITLES) if Act.csvFormat() else None
|
||||||
roleId = None
|
roleId = None
|
||||||
userKey = None
|
userKey = None
|
||||||
showPrivileges = False
|
oneItemPerRow = showPrivileges = False
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
|
rolePrivileges = {}
|
||||||
fieldsList = PRINT_ADMIN_FIELDS
|
fieldsList = PRINT_ADMIN_FIELDS
|
||||||
assignedToIdEmailMap = {}
|
assignedToIdEmailMap = {}
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
@ -16327,19 +16345,19 @@ def doPrintShowAdmins():
|
|||||||
_, roleId = getRoleId()
|
_, roleId = getRoleId()
|
||||||
elif myarg == 'condition':
|
elif myarg == 'condition':
|
||||||
fieldsList.append('condition')
|
fieldsList.append('condition')
|
||||||
PRINT_ADMIN_TITLES.append('condition')
|
if csvPF:
|
||||||
|
csvPF.AddTitle('condition')
|
||||||
cd = buildGAPIObject(API.DIRECTORY_BETA)
|
cd = buildGAPIObject(API.DIRECTORY_BETA)
|
||||||
elif myarg == 'privileges':
|
elif myarg == 'privileges':
|
||||||
showPrivileges = True
|
showPrivileges = True
|
||||||
PRINT_ADMIN_TITLES.append('rolePrivileges')
|
elif myarg == 'oneitemperrow':
|
||||||
|
oneItemPerRow = True
|
||||||
else:
|
else:
|
||||||
unknownArgumentExit()
|
unknownArgumentExit()
|
||||||
if roleId and not kwargs:
|
if roleId and not kwargs:
|
||||||
kwargs['roleId'] = roleId
|
kwargs['roleId'] = roleId
|
||||||
roleId = None
|
roleId = None
|
||||||
fields = getItemFieldsFromFieldsList('items', fieldsList)
|
fields = getItemFieldsFromFieldsList('items', fieldsList)
|
||||||
if csvPF:
|
|
||||||
csvPF.SetTitles(PRINT_ADMIN_TITLES)
|
|
||||||
printGettingAllAccountEntities(Ent.ADMIN_ROLE_ASSIGNMENT)
|
printGettingAllAccountEntities(Ent.ADMIN_ROLE_ASSIGNMENT)
|
||||||
try:
|
try:
|
||||||
admins = callGAPIpages(cd.roleAssignments(), 'list', 'items',
|
admins = callGAPIpages(cd.roleAssignments(), 'list', 'items',
|
||||||
@ -16380,7 +16398,14 @@ def doPrintShowAdmins():
|
|||||||
if roleId and roleId != admin['roleId']:
|
if roleId and roleId != admin['roleId']:
|
||||||
continue
|
continue
|
||||||
_setNamesFromIds(admin, _getPrivileges(admin))
|
_setNamesFromIds(admin, _getPrivileges(admin))
|
||||||
csvPF.WriteRowTitles(flattenJSON(admin))
|
if not oneItemPerRow or 'rolePrivileges' not in admin:
|
||||||
|
csvPF.WriteRowTitles(flattenJSON(admin))
|
||||||
|
else:
|
||||||
|
privileges = admin.pop('rolePrivileges')
|
||||||
|
baserow = flattenJSON(admin)
|
||||||
|
for privilege in privileges:
|
||||||
|
row = flattenJSON(privilege, flattened=baserow.copy())
|
||||||
|
csvPF.WriteRowTitles(row)
|
||||||
if csvPF:
|
if csvPF:
|
||||||
csvPF.writeCSVfile('Admins')
|
csvPF.writeCSVfile('Admins')
|
||||||
|
|
||||||
@ -58345,7 +58370,7 @@ def updateGoogleDocument(users):
|
|||||||
i, count, users = getEntityArgument(users)
|
i, count, users = getEntityArgument(users)
|
||||||
for user in users:
|
for user in users:
|
||||||
i += 1
|
i += 1
|
||||||
user, drive, jcount = _validateUserGetFileIDs(user, i, count, fileIdEntity, entityType=Ent.DOCUMENT if not FJQC.formatJSON else None)
|
user, _, jcount = _validateUserGetFileIDs(user, i, count, fileIdEntity, entityType=Ent.DOCUMENT if not FJQC.formatJSON else None)
|
||||||
if jcount == 0:
|
if jcount == 0:
|
||||||
continue
|
continue
|
||||||
_, docs = buildGAPIServiceObject(API.DOCS, user, i, count)
|
_, docs = buildGAPIServiceObject(API.DOCS, user, i, count)
|
||||||
|
@ -250,7 +250,7 @@ DRIVE3_MODIFY_LABEL_THROW_REASONS = DRIVE_USER_THROW_REASONS+[FILE_NOT_FOUND, NO
|
|||||||
LABEL_MULTIPLE_VALUES_FOR_SINGULAR_FIELD, LABEL_MUTATION_FORBIDDEN,
|
LABEL_MULTIPLE_VALUES_FOR_SINGULAR_FIELD, LABEL_MUTATION_FORBIDDEN,
|
||||||
LABEL_MUTATION_ILLEGAL_SELECTION, LABEL_MUTATION_UNKNOWN_FIELD]
|
LABEL_MUTATION_ILLEGAL_SELECTION, LABEL_MUTATION_UNKNOWN_FIELD]
|
||||||
DOCS_ACCESS_THROW_REASONS = DRIVE_USER_THROW_REASONS+[NOT_FOUND, PERMISSION_DENIED, FORBIDDEN, INTERNAL_ERROR, INSUFFICIENT_FILE_PERMISSIONS,
|
DOCS_ACCESS_THROW_REASONS = DRIVE_USER_THROW_REASONS+[NOT_FOUND, PERMISSION_DENIED, FORBIDDEN, INTERNAL_ERROR, INSUFFICIENT_FILE_PERMISSIONS,
|
||||||
BAD_REQUEST, INVALID, INVALID_ARGUMENT, FAILED_PRECONDITION]
|
BAD_REQUEST, INVALID, INVALID_ARGUMENT, FAILED_PRECONDITION]
|
||||||
GMAIL_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST]
|
GMAIL_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST]
|
||||||
GMAIL_LIST_THROW_REASONS = [FAILED_PRECONDITION, PERMISSION_DENIED, INVALID, INVALID_ARGUMENT]
|
GMAIL_LIST_THROW_REASONS = [FAILED_PRECONDITION, PERMISSION_DENIED, INVALID, INVALID_ARGUMENT]
|
||||||
GMAIL_SMIME_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST, INVALID_ARGUMENT, FORBIDDEN, NOT_FOUND, PERMISSION_DENIED]
|
GMAIL_SMIME_THROW_REASONS = [SERVICE_NOT_AVAILABLE, BAD_REQUEST, INVALID_ARGUMENT, FORBIDDEN, NOT_FOUND, PERMISSION_DENIED]
|
||||||
|
Reference in New Issue
Block a user