diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 5ed6e1cd..6fbe545c 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,14 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 6.79.09 + +Added option `addcsvdata ` to `gam print teamdriveacls` that adds +additional columns of data to the CSV file output. This can be used when ACLs for selected users are to be +replaced with a different user email address. + +* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Shared-Drives#bulk-change-user1-shared-drive-access-to-user2 + ### 6.79.08 Clarified action to perform messages when creating/deleting/updating licenses. diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index d3ea9b68..f428f14b 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin$ gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 6.79.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -923,7 +923,7 @@ writes the credentials into the file oauth2.txt. C:\>del C:\GAMConfig\oauth2.txt C:\>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.79.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Users-Shared-Drives.md b/docs/Users-Shared-Drives.md index b99746ac..4cd41e01 100644 --- a/docs/Users-Shared-Drives.md +++ b/docs/Users-Shared-Drives.md @@ -15,7 +15,8 @@ - [Display Shared Drive access](#display-shared-drive-access) - [Display Shared Drive access for specific Shared Drives](#display-shared-drive-access-for-specific-shared-drives) - [Display Shared Drive access for selected Shared Drives](#display-shared-drive-access-for-selected-shared-drives) -- [Change User1 Shared Drive access to User2](#change-user1-shared-drive-access-to-user2) +- [Change single User1 Shared Drive access to User2](#change-single-user1-shared-drive-access-to-user2) +- [Bulk change User1 Shared Drive access to User2](#bulk-change-user1-shared-drive-access-to-user2) - [Display empty folders on a Shared Drive](#display-empty-folders-on-a-shared-drive) - [Delete empty folders on a Shared Drive](#delete-empty-folders-on-a-shared-drive) - [Empty the trash on a Shared Drive](#empty-the-trash-on-a-shared-drive) @@ -464,14 +465,27 @@ gam print emptydrivefolders [todrive *] select ``` -## Change User1 Shared Drive access to User2 +## Change single User1 Shared Drive access to User2 ``` # Get Shared Drives for User1 gam redirect csv ./U1SharedDrives.csv user user1@domain.com print shareddriveacls pm emailaddress user1@domain.com em oneitemperrow # For each of those Shared Drives, delete User1 access -gam redirect stdout ./DeleteU1SharedDriveAccess.txt multiprocess redirect stderr stdout gam delete drivefileacl "~id" "~permission.emailAddress" +gam redirect stdout ./DeleteU1SharedDriveAccess.txt multiprocess redirect stderr stdout csv ./U1SharedDrives.csv gam delete drivefileacl "~id" "~permission.emailAddress" # For each of those Shared Drives, add User2 with the same role that User1 had -gam redirect stdout ./AddU2SharedDriveAccess.txt multiprocess redirect stderr stdout gam create drivefileacl "~id" user user2@domain.com role "~permission.role" +gam redirect stdout ./AddU2SharedDriveAccess.txt multiprocess redirect stderr stdout csv ./U1SharedDrives.csv gam create drivefileacl "~id" user user2@domain.com role "~permission.role" +``` + +## Bulk change User1 Shared Drive access to User2 +This requires GAM version 6.79.09 or higher. + +Make a CSV file Users.csv with two email address columns: User,Replace +``` +# Get Shared Drives for all Users in CSV file +gam redirect csv ./U1SharedDrives.csv multiprocess csv Users.csv gam user "~User" print shareddriveacls pm emailaddress "~User" em oneitemperrow addscvdata Replace "~Replace" +# For each of those Shared Drives, delete User access +gam redirect stdout ./DeleteU1SharedDriveAccess.txt multiprocess redirect stderr stdout csv ./U1SharedDrives.csv gam delete drivefileacl "~id" "~permission.emailAddress" +# For each of those Shared Drives, add Replace with the same role that User had +gam redirect stdout ./AddU2SharedDriveAccess.txt multiprocess redirect stderr stdout csv ./U1SharedDrives.csv gam create drivefileacl "~id" user "~Replace" role "~permission.role" ``` ## Delete empty folders on a Shared Drive diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 0f8dfac1..45310b4b 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.79.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -15,7 +15,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 6.79.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -27,7 +27,7 @@ Your system time differs from www.googleapis.com by less than 1 second Print the current version of Gam with extended details and SSL information ``` gam version extended -GAMADV-XTD3 6.79.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.79.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.79.08 + Latest: 6.79.09 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -6.79.08 +6.79.09 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.79.08 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.79.09 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.4 64-bit final MacOS Sonoma 14.5 x86_64 diff --git a/src/GamCommands.txt b/src/GamCommands.txt index 6c12e0b0..65b79f93 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -4928,6 +4928,7 @@ gam print teamdriveacls [todrive *] [user|group [checkgroups]] (role|roles )* * [] [pmselect] [oneitemperrow] [*|(fields )] + (addcsvdata )* [formatjson [quotechar ]] gam show teamdriveacls [teamdriveadminquery|query ] @@ -4957,6 +4958,7 @@ gam print teamdriveacls [todrive *] * [] [pmselect] [oneitemperrow] [*|(fields )] [shownopermissionsdrives false|true|only] + (addcsvdata )* [formatjson [quotechar ]] gam show teamdriveacls [adminaccess|asadmin] [teamdriveadminquery|query ] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 1b0dc70d..f03020db 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,14 @@ Merged GAM-Team version +6.79.09 + +Added option `addcsvdata ` to `gam print teamdriveacls` that adds +additional columns of data to the CSV file output. This can be used when ACLs for selected users are to be +replaced with a different user email address. + +* See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Shared-Drives#bulk-change-user1-shared-drive-access-to-user2 + 6.79.08 Clarified action to perform messages when creating/deleting/updating licenses. @@ -285,7 +293,7 @@ and was `Waiting for N running processes to finish before terminating`. Fixed bug in `gam print messages ... positivecountsonly` where message counts with value 0 were deiplayed. -Added option `addcsvdata ` to `gam print|messages` that adds +Added option `addcsvdata ` to `gam print messages` that adds additional columns of data to the CSV file output. Added option `showusagebytes` to `gam print|show drivesettings` that displays diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 16ee2353..ab48ee92 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -16854,7 +16854,7 @@ def doPrintShowDataTransfers(): status = getChoice(DATA_TRANSFER_STATUS_MAP, mapChoice=True) elif myarg == 'delimiter': delimiter = getCharacter() - elif myarg == 'addcsvdata': + elif csvPF and myarg == 'addcsvdata': k = getString(Cmd.OB_STRING) addCSVData[k] = getString(Cmd.OB_STRING, minLen=0) else: @@ -55134,7 +55134,6 @@ def _showComment(comment, stripPhotoLinks, timeObjects, i=0, count=0, FJQC=None) # [showdeleted] [start |