Updated gam remove aliases <EmailAddress> user|group <EmailAddressEntity>

This commit is contained in:
Ross Scroggs
2024-01-19 08:12:27 -08:00
parent 432ef09129
commit 53d1ce5ddb
7 changed files with 47 additions and 18 deletions

View File

@@ -85,7 +85,7 @@ gam <UserTypeEntity> delete aliases
``` ```
## Display aliases ## Display aliases
Display a specific alise. Display a specific alias.
``` ```
gam info alias|aliases <EmailAddressEntity> gam info alias|aliases <EmailAddressEntity>
``` ```

View File

@@ -11,6 +11,15 @@ 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.67.21
Updated `gam remove aliases <EmailAddress> user|group <EmailAddressEntity>` to give a more informative
error message when the target/alias combination does not exist.
```
Old: User: testsimple@rdschool.org, User Alias: tsalias@rdschool.org, Remove Failed: Invalid Input: resource_id
New: User: testsimple@rdschool.org, User Alias: tsalias@rdschool.org, Remove Failed: Does not exist
```
### 6.67.20 ### 6.67.20
Added option `onelicenseperrow|onelicenceperrow` to `gam print users ... licenses` that causes GAM to print Added option `onelicenseperrow|onelicenceperrow` to `gam print users ... licenses` that causes GAM to print

View File

@@ -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.67.20 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.21 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.1 64-bit final Python 3.12.1 64-bit final
MacOS Sonoma 14.2.1 x86_64 MacOS Sonoma 14.2.1 x86_64
@@ -1002,7 +1002,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.67.20 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.21 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.1 64-bit final Python 3.12.1 64-bit final
Windows-10-10.0.17134 AMD64 Windows-10-10.0.17134 AMD64

View File

@@ -1,6 +1,7 @@
# Reseller # Reseller
- [API documentation](#api-documentation) - [API documentation](#api-documentation)
- [Notes](#notes) - [Notes](#notes)
- [Manage Multiple Domains](#manage-multiple-domains)
- [Definitions](#definitions) - [Definitions](#definitions)
- [Manage Resold Customers](#manage-resold-customers) - [Manage Resold Customers](#manage-resold-customers)
- [Display Resold Customers](#display-resold-customers) - [Display Resold Customers](#display-resold-customers)
@@ -25,6 +26,11 @@ Prior to version 6.50.00, this is how the `seats <NumberOfSeats> <MaximumNumberO
Now, you can still use the above option which has been corrected or you can specify `seats <Number>` which will be properly passed in the correct form to the API based on plan name. Now, you can still use the above option which has been corrected or you can specify `seats <Number>` which will be properly passed in the correct form to the API based on plan name.
## Manage Multiple Domains
Thanks to Duncan Isaksen-Loxton for a script to help manage multiple domains.
* See: https://gist.github.com/65/b5e9cee9b5812b487b8ae3e8256e262b
## Definitions ## Definitions
``` ```
<CustomerID> ::= <String> <CustomerID> ::= <String>

View File

@@ -4,7 +4,7 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAMADV-XTD3 6.67.20 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.21 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.1 64-bit final Python 3.12.1 64-bit final
MacOS Sonoma 14.2.1 x86_64 MacOS Sonoma 14.2.1 x86_64
@@ -16,7 +16,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.67.20 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.21 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.1 64-bit final Python 3.12.1 64-bit final
MacOS Sonoma 14.2.1 x86_64 MacOS Sonoma 14.2.1 x86_64
@@ -28,7 +28,7 @@ Your system time differs from www.googleapis.com by less than 1 second
Print the current version of Gam with extended details and SSL information Print the current version of Gam with extended details and SSL information
``` ```
gam version extended gam version extended
GAMADV-XTD3 6.67.20 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.67.21 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.1 64-bit final Python 3.12.1 64-bit final
MacOS Sonoma 14.2.1 x86_64 MacOS Sonoma 14.2.1 x86_64
@@ -65,7 +65,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.67.20 Latest: 6.67.21
echo $? echo $?
1 1
``` ```
@@ -73,7 +73,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
6.67.20 6.67.21
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@@ -83,7 +83,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.67.20 - https://github.com/taers232c/GAMADV-XTD3 GAM 6.67.21 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.1 64-bit final Python 3.12.1 64-bit final
MacOS Sonoma 14.2.1 x86_64 MacOS Sonoma 14.2.1 x86_64

View File

@@ -2,6 +2,15 @@
Merged GAM-Team version Merged GAM-Team version
6.67.21
Updated `gam remove aliases <EmailAddress> user|group <EmailAddressEntity>` to give a more informative
error message when the target/alias combination does not exist.
```
Old: User: testsimple@rdschool.org, User Alias: tsalias@rdschool.org, Remove Failed: Invalid Input: resource_id
New: User: testsimple@rdschool.org, User Alias: tsalias@rdschool.org, Remove Failed: Does not exist
```
6.67.20 6.67.20
Added option `onelicenseperrow|onelicenceperrow` to `gam print users ... licenses` that causes GAM to print Added option `onelicenseperrow|onelicenceperrow` to `gam print users ... licenses` that causes GAM to print

View File

@@ -17591,8 +17591,10 @@ def doRemoveAliases():
GAPI.CONDITION_NOT_MET], GAPI.CONDITION_NOT_MET],
userKey=targetEmail, alias=aliasEmail) userKey=targetEmail, alias=aliasEmail)
entityActionPerformed([Ent.USER, targetEmail, Ent.USER_ALIAS, aliasEmail], i, count) entityActionPerformed([Ent.USER, targetEmail, Ent.USER_ALIAS, aliasEmail], i, count)
except (GAPI.userNotFound, GAPI.badRequest, GAPI.invalid, GAPI.forbidden, GAPI.invalidResource, GAPI.conditionNotMet) as e: except (GAPI.userNotFound, GAPI.badRequest, GAPI.invalid, GAPI.forbidden, GAPI.conditionNotMet) as e:
entityActionFailedWarning([Ent.USER, targetEmail, Ent.USER_ALIAS, aliasEmail], str(e), i, count) entityActionFailedWarning([Ent.USER, targetEmail, Ent.USER_ALIAS, aliasEmail], str(e), i, count)
except GAPI.invalidResource:
entityActionFailedWarning([Ent.USER, targetEmail, Ent.USER_ALIAS, aliasEmail], Msg.DOES_NOT_EXIST, i, count)
else: else:
try: try:
for aliasEmail in entityList: for aliasEmail in entityList:
@@ -17603,8 +17605,10 @@ def doRemoveAliases():
GAPI.CONDITION_NOT_MET], GAPI.CONDITION_NOT_MET],
groupKey=targetEmail, alias=aliasEmail) groupKey=targetEmail, alias=aliasEmail)
entityActionPerformed([Ent.GROUP, targetEmail, Ent.GROUP_ALIAS, aliasEmail], i, count) entityActionPerformed([Ent.GROUP, targetEmail, Ent.GROUP_ALIAS, aliasEmail], i, count)
except (GAPI.groupNotFound, GAPI.userNotFound, GAPI.badRequest, GAPI.invalid, GAPI.forbidden, GAPI.invalidResource, GAPI.conditionNotMet) as e: except (GAPI.groupNotFound, GAPI.userNotFound, GAPI.badRequest, GAPI.invalid, GAPI.forbidden, GAPI.conditionNotMet) as e:
entityActionFailedWarning([Ent.GROUP, targetEmail, Ent.GROUP_ALIAS, aliasEmail], str(e), i, count) entityActionFailedWarning([Ent.GROUP, targetEmail, Ent.GROUP_ALIAS, aliasEmail], str(e), i, count)
except GAPI.invalidResource:
entityActionFailedWarning([Ent.GROUP, targetEmail, Ent.GROUP_ALIAS, aliasEmail], Msg.DOES_NOT_EXIST, i, count)
def _addUserAliases(cd, user, aliasList, i, count): def _addUserAliases(cd, user, aliasList, i, count):
jcount = len(aliasList) jcount = len(aliasList)
@@ -40727,7 +40731,10 @@ class PasswordOptions():
elif self.b64DecryptPassword: elif self.b64DecryptPassword:
if body[up].lower()[:5] in ['{md5}', '{sha}']: if body[up].lower()[:5] in ['{md5}', '{sha}']:
body[up] = body[up][5:] body[up] = body[up][5:]
try:
body[up] = base64.b64decode(body[up]).hex() body[up] = base64.b64decode(body[up]).hex()
except Exception as e:
pass
def AssignPassword(self, body, notify, notFoundBody, createIfNotFound): def AssignPassword(self, body, notify, notFoundBody, createIfNotFound):
up = 'password' up = 'password'
@@ -42837,9 +42844,10 @@ def doPrintUsers(entityList=None):
csvPF.AddTitles(['Groups']) csvPF.AddTitles(['Groups'])
if printOptions['getLicenseFeed'] or printOptions['getLicenseFeedByUser']: if printOptions['getLicenseFeed'] or printOptions['getLicenseFeedByUser']:
if not oneLicensePerRow: if not oneLicensePerRow:
csvPF.AddTitles(['LicensesCount', 'Licenses', 'LicensesDisplay']) licenseTitles = ['LicensesCount', 'Licenses', 'LicensesDisplay']
else: else:
csvPF.AddTitles(['License', 'LicenseDisplay']) licenseTitles = ['License', 'LicenseDisplay']
csvPF.AddTitles(licenseTitles)
if printOptions['getLicenseFeed']: if printOptions['getLicenseFeed']:
if skus is None and GM.Globals[GM.LICENSE_SKUS]: if skus is None and GM.Globals[GM.LICENSE_SKUS]:
skus = GM.Globals[GM.LICENSE_SKUS] skus = GM.Globals[GM.LICENSE_SKUS]
@@ -42979,10 +42987,7 @@ def doPrintUsers(entityList=None):
else: else:
csvPF.MoveTitlesToEnd(['Groups']+[f'Groups{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{j}' for j in range(printOptions['maxGroups'])]) csvPF.MoveTitlesToEnd(['Groups']+[f'Groups{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{j}' for j in range(printOptions['maxGroups'])])
if printOptions['getLicenseFeed'] or printOptions['getLicenseFeedByUser']: if printOptions['getLicenseFeed'] or printOptions['getLicenseFeedByUser']:
if not oneLicensePerRow: csvPF.MoveTitlesToEnd(licenseTitles)
csvPF.MoveTitlesToEnd(['LicensesCount', 'Licenses', 'LicensesDisplay'])
else:
csvPF.MoveTitlesToEnd(['License', 'LicenseDisplay'])
elif not FJQC.formatJSON: elif not FJQC.formatJSON:
for domain, count in sorted(iter(domainCounts.items())): for domain, count in sorted(iter(domainCounts.items())):
csvPF.WriteRowNoFilter({'domain': domain, 'count': count}) csvPF.WriteRowNoFilter({'domain': domain, 'count': count})