From 0290f0d0ceba165f72421386e377f819fcfd1732 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Tue, 10 Feb 2026 21:31:07 -0800 Subject: [PATCH] Replace teamdrive with shareddrive --- wiki/Collections-of-Items.md | 12 +++--- wiki/Collections-of-Users.md | 6 +-- wiki/Drive-File-Selection.md | 43 ++++++++++---------- wiki/Drive-Items.md | 6 +-- wiki/Shared-Drives.md | 42 ++++++++++---------- wiki/Users-Drive-Cleanup.md | 4 +- wiki/Users-Drive-Copy-Move.md | 66 +++++++++++++++---------------- wiki/Users-Drive-Files-Display.md | 10 ++--- wiki/Users-Drive-Files-Manage.md | 30 +++++++------- wiki/Users-Drive-Ownership.md | 14 +++---- wiki/Users-Drive-Permissions.md | 4 +- wiki/Users-Drive-Shortcuts.md | 18 ++++----- wiki/Users-Shared-Drives.md | 34 ++++++++-------- 13 files changed, 147 insertions(+), 142 deletions(-) diff --git a/wiki/Collections-of-Items.md b/wiki/Collections-of-Items.md index d25315ad..e815805d 100644 --- a/wiki/Collections-of-Items.md +++ b/wiki/Collections-of-Items.md @@ -319,6 +319,8 @@ Data fields identified in a `csvkmd` argument. (select | | ) ::= | | + :: = See: https://developers.google.com/workspace/drive/api/guides/search-files + ::= See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives ::= | (select ) ::= @@ -329,22 +331,22 @@ Data fields identified in a `csvkmd` argument. | | ::= | - (teamdriveid ) | (teamdriveid:) + (shareddriveid ) | (shareddriveid:) ::= - (teamdrive ) | (teamdrive:) + (shareddrive ) | (shareddrive:) ::= | ::= - (teamdriveadminquery ) | (teamdriveadminquery:) + (shareddriveadminquery ) | (shareddriveadminquery:) ::= | | ::= - (teamdrivefilename ) | (teamdrivefilename:) + (shareddrivefilename ) | (shareddrivefilename:) ::= - (teamdrivequery ) | (teamdrivequery:) + (shareddrivequery ) | (shareddrivequery:) ::= all_files | all_folders | all_google_files | all_non_google_files | all_items ::= diff --git a/wiki/Collections-of-Users.md b/wiki/Collections-of-Users.md index 8a56a288..06dc0e54 100644 --- a/wiki/Collections-of-Users.md +++ b/wiki/Collections-of-Users.md @@ -114,9 +114,9 @@ ous_and_children_na_ns (anydrivefilename )|(anydrivefilename:) ::= ::= - ::= (teamdriveid ) | (teamdriveid:) - ::= (teamdrive ) | (teamdrive:) - ::= (teamdrivefilename ) | (teamdrivefilename:) + ::= (shareddriveid ) | (shareddriveid:) + ::= (shareddrive ) | (shareddrive:) + ::= (shareddrivefilename ) | (shareddrivefilename:) ::= | diff --git a/wiki/Drive-File-Selection.md b/wiki/Drive-File-Selection.md index 733a3f54..151a5bf7 100644 --- a/wiki/Drive-File-Selection.md +++ b/wiki/Drive-File-Selection.md @@ -49,7 +49,8 @@ ::= ::= "(,)*" ::= - :: = See: https://developers.google.com/drive/api/v3/search-files + :: = See: https://developers.google.com/workspace/drive/api/guides/search-files + ::= See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives ::= (query ) | (query:) ::= @@ -90,15 +91,15 @@ ::= ::= - ::= (teamdriveid ) | (teamdriveid:) - ::= (teamdrive ) | (teamdrive:) - ::= (teamdrivefilename ) | (teamdrivefilename:) + ::= (shareddriveid ) | (shareddriveid:) + ::= (shareddrive ) | (shareddrive:) + ::= (shareddrivefilename ) | (shareddrivefilename:) ::= | ::= - (teamdriveadminquery ) | (teamdriveadminquery:) + (shareddriveadminquery ) | (shareddriveadminquery:) ::= (query ) | (query:) ::= @@ -335,13 +336,13 @@ Select a Shared Drive file by giving its unique ID. ``` ::= | - (teamdriveid ) | (teamdriveid:) + (shareddriveid ) | (shareddriveid:) ``` ### Examples ``` gam user testuser show fileinfo 1234ABCD gam user testuser show fileinfo id 1234ABCD -gam user testuser show fileinfo teamdriveid 1234ABCD +gam user testuser show fileinfo shareddriveid 1234ABCD ``` ## Select Shared Drive file by name If you have the name, a search must be performed to find the ID that matches the name. @@ -350,16 +351,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. ``` ::= - (teamdriveid ) | (teamdriveid:) + (shareddriveid ) | (shareddriveid:) ::= - (teamdrive ) | (teamdrive:) + (shareddrive ) | (shareddrive:) ::= - (teamdrivefilename ) | (teamdrivefilename:) + (shareddrivefilename ) | (shareddrivefilename:) ``` ### Examples ``` -gam user testuser show fileinfo teamdriveid 1234ABCD teamdrivefilename "Test File" -gam user testuser show fileinfo teamdrive "Shared Drive 1" teamdrivefilename "Test File" +gam user testuser show fileinfo shareddriveid 1234ABCD shareddrivefilename "Test File" +gam user testuser show fileinfo shareddrive "Shared Drive 1" shareddrivefilename "Test File" ``` ## 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. @@ -367,7 +368,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) ``` ::= - (teamdrivequery ) | (teamdrivequery:) + (shareddrivequery ) | (shareddrivequery:) ::= all_files | all_folders | all_google_files | all_non_google_files | all_items ``` @@ -380,32 +381,32 @@ Keyword to query mappings for ``: ### Examples ``` -gam user testuser show fileinfo teamdrivequery "name='Test File'" -gam user testuser show fileinfo teamdriveid 1234ABCD teamdrivequery "name='Test File'" -gam user testuser show fileinfo teamdrive teamdrive "Shared Drive 1" teamdrivequery "name='Test File'" -gam user testuser show fileinfo teamdriveid 1234ABCD all_non_google_files +gam user testuser show fileinfo shareddrivequery "name='Test File'" +gam user testuser show fileinfo shareddriveid 1234ABCD shareddrivequery "name='Test File'" +gam user testuser show fileinfo shareddrive shareddrive "Shared Drive 1" shareddrivequery "name='Test File'" +gam user testuser show fileinfo shareddriveid 1234ABCD all_non_google_files ``` ## 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. ``` ::= | - (teamdriveid ) | (teamdriveid:) + (shareddriveid ) | (shareddriveid:) ``` ### Examples ``` gam user testuser show fileinfo 1234ABCD -gam user testuser show fileinfo teamdriveid 1234ABCD +gam user testuser show fileinfo shareddriveid 1234ABCD ``` ## 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. ``` ::= - (teamdrive ) | (teamdrive:) + (shareddrive ) | (shareddrive:) ``` ### Examples ``` -gam user testuser show fileinfo teamdrive "Shared Drive 1" +gam user testuser show fileinfo shareddrive "Shared Drive 1" ``` diff --git a/wiki/Drive-Items.md b/wiki/Drive-Items.md index 03aaca41..a5484d78 100644 --- a/wiki/Drive-Items.md +++ b/wiki/Drive-Items.md @@ -27,13 +27,13 @@ (anydrivefilename ) | (anydrivefilename:) ::= | - (teamdriveid ) | (teamdriveid:) + (shareddriveid ) | (shareddriveid:) ::= ::= - (teamdrive ) | (teamdrive:) + (shareddrive ) | (shareddrive:) ::= | ::= - (teamdrivefilename ) | (teamdrivefilename:) + (shareddrivefilename ) | (shareddrivefilename:) ``` diff --git a/wiki/Shared-Drives.md b/wiki/Shared-Drives.md index 9477bb24..ad14488a 100644 --- a/wiki/Shared-Drives.md +++ b/wiki/Shared-Drives.md @@ -171,7 +171,7 @@ withlink ::= "(,)*" - ::= See: https://developers.google.com/drive/api/v3/search-parameters + ::= See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives ::= manager|organizer|owner| contentmanager|fileorganizer| @@ -183,8 +183,8 @@ ::= ::= | - (teamdriveid )|(teamdriveid:)| - (teamdrive )|(teamdrive:) + (shareddriveid )|(shareddriveid:)| + (shareddrive )|(shareddrive:) ::= backgroundimagefile| @@ -199,11 +199,11 @@ ::= "(,)*" ::= - |(teamdriveid )|(teamdriveid:) + |(shareddriveid )|(shareddriveid:) ::= - (teamdrive )|(teamdrive:) + (shareddrive )|(shareddrive:) ::= - (teamdriveadminquery )|(teamdriveadminquery:) + (shareddriveadminquery )|(shareddriveadminquery:) ::= | @@ -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`: ``` Linux/MacOS -teamDriveId=$(gam create shareddrive ... returnidonly) +shareddriveId=$(gam create shareddrive ... returnidonly) Windows PowerShell -$teamDriveId = & gam create shareddrive ... returnidonly +$shareddriveId = & gam create shareddrive ... returnidonly Windows Command Prompt -for /f "delims=" %a in ('gam create shareddrive ... returnidonly') do set teamDriveId=%a +for /f "delims=" %a in ('gam create shareddrive ... returnidonly') do set shareddriveId=%a ``` ## 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. ``` gam [] show shareddrives - [adminaccess|asadmin] [teamdriveadminquery|query ] + [adminaccess|asadmin] [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] [fields ] [showwebviewlink text|hyperlink] [formatjson] ``` By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `matchname ` - Retrieve Shared Drives with names that match a pattern. * `orgunit|org|ou ` - 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. ``` gam [] print shareddrives [todrive *] - [adminaccess|asadmin] [teamdriveadminquery|query ] + [adminaccess|asadmin] [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] [fields ] [showwebviewlink text|hyperlink] [formatjson [quotechar ]] ``` By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `matchname ` - Retrieve Shared Drives with names that match a pattern. * `orgunit|org|ou ` - 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`. By default, organizers for all Shared Drives are displayed; use the following options to select a subset of Shared Drives: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `shareddrives|teamdrives ` - Select the Shared Drive IDs specified in `` * `shareddrives|teamdrives select |` - Select the Shared Drive IDs specified in `|` * `orgunit|org|ou ` - 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. ``` gam [] show|print shareddrives - [adminaccess|asadmin] [teamdriveadminquery|query ] + [adminaccess|asadmin] [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] showitemcountonly ``` By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `matchname ` - Retrieve Shared Drives with names that match a pattern. * `orgunit|org|ou ` - 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 ``` gam [] show shareddriveacls - [adminaccess|asadmin] [teamdriveadminquery|query ] + [adminaccess|asadmin] [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] [user|group [checkgroups]] (role|roles )* * [] [pmselect] @@ -767,7 +767,7 @@ gam [] show shareddriveacls [formatjson] gam [] print shareddriveacls [todrive *] - [adminaccess|asadmin] [teamdriveadminquery|query ] + [adminaccess|asadmin] [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] [user|group [checkgroups]] (role|roles )* * [] [pmselect] @@ -777,7 +777,7 @@ gam [] print shareddriveacls [todrive *] ``` By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `matchname ` - Retrieve Shared Drives with names that match a pattern. * `orgunit|org|ou ` - Only Shared Drives in the specified Org Unit are selected * `* [] 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 ``` # 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 ./TeamDriveOrganizers.csv print shareddriveorganizers domainlist mydomain.com includetypes user oneorganizer shownoorganizerdrives +gam config csv_output_row_filter "createdTime:date<-1y" redirect csv ./ShareddriveOrganizers.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 # 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 ./TeamDriveOrganizers.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 ./ShareddriveOrganizers.csv gam user "~organizers" print filecounts select shareddriveid "~id" showsize # Inspect OldEmptySharedDrives.csv, if you're confident of the results, proceed diff --git a/wiki/Users-Drive-Cleanup.md b/wiki/Users-Drive-Cleanup.md index 4dc4d95b..f21fcc9f 100644 --- a/wiki/Users-Drive-Cleanup.md +++ b/wiki/Users-Drive-Cleanup.md @@ -18,8 +18,8 @@ ::= ::= ::= - |(teamdriveid )|(teamdriveid:)| - (teamdrive )|(teamdrive:) + |(shareddriveid )|(shareddriveid:)| + (shareddrive )|(shareddrive:) ``` ## Display empty folders ``` diff --git a/wiki/Users-Drive-Copy-Move.md b/wiki/Users-Drive-Copy-Move.md index 3a8aeb13..adb10b35 100644 --- a/wiki/Users-Drive-Copy-Move.md +++ b/wiki/Users-Drive-Copy-Move.md @@ -68,10 +68,10 @@ (parentid )| (parentname )| (anyownerparentname )| - (teamdriveparentid )| - (teamdriveparent )| - (teamdriveparentid teamdriveparentname )| - (teamdriveparent teamdriveparentname ) + (shareddriveparentid )| + (shareddriveparent )| + (shareddriveparentid shareddriveparentname )| + (shareddriveparent shareddriveparentname ) ::= (contentrestrictions readonly false)| @@ -231,10 +231,10 @@ and "Template" is replaced by "NewCustomer" in all copied sub files and folders * `parentid ` - The target folder is identified by `` which must be writable by ``. * `parentname ` - A search is performed for a folder named `` owned by ``. * `anyownerparentname ` - A search is performed for a folder named `` owned by any user but must be writable by ``. -* `teamdriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder. -* `teamdriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. -* `teamdriveparentid teamdriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. -* `teamdriveparent teamdriveparentname ` - A Shared Drive name and a folder name on that Shared Drive. +* `shareddriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder. +* `shareddriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. +* `shareddriveparentid shareddriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. +* `shareddriveparent shareddriveparentname ` - 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. ### Duplicate files @@ -414,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 `` ``` -gam user user@domain.com copy drivefile root recursive teamdriveparentid mergewithparent true +gam user user@domain.com copy drivefile root recursive shareddriveparentid mergewithparent true ``` Files/folders in root of My Drive will be in a new folder named `My Drive` created in `` ``` -gam user user@domain.com copy drivefile root recursive teamdriveparentid mergewithparent false +gam user user@domain.com copy drivefile root recursive shareddriveparentid mergewithparent false ``` Files/folders in root of My Drive will be in a new folder named `` created in `` ``` -gam user user@domain.com copy drivefile root recursive teamdriveparentid mergewithparent false newfilename +gam user user@domain.com copy drivefile root recursive shareddriveparentid mergewithparent false newfilename ``` ### Copy content of a Shared Drive to another Shared Drive @@ -438,7 +438,7 @@ The example is assuming that the target drive is empty. * Non-inherited sub folder permissions are copied. * Non-inherited file permissions are copied. ``` -gam user user@domain.com copy drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX mergewithparent recursive +gam user user@domain.com copy drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX mergewithparent recursive copymergewithparentfolderpermissions true copytopfolderinheritedpermissions false copytopfoldernoninheritedpermissions always @@ -458,7 +458,7 @@ Suppose that the source drive has been updated and you want to refresh the targe * Non-inherited file permissions are copied. * Files and folders that have been deleted from the source drive will remain on the target drive ``` -gam user user@domain.com copy drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX mergewithparent recursive +gam user user@domain.com copy drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX mergewithparent recursive copymergewithparentfolderpermissions true copytopfolderinheritedpermissions false copytopfoldernoninheritedpermissions syncallfolders @@ -478,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 ``` -gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive teamdriveparentid 0AE_9ZX +gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid 0AE_9ZX ``` ### Copy content of a source Shared Drive folder to a target Shared Drive with parallel Processing @@ -488,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. ``` -gam user user@domain.com create drivefile mimetype gfolder teamdriveparentid 0AE-9ZX drivefilename "New Folder Name" returnidonly +gam user user@domain.com create drivefile mimetype gfolder shareddriveparentid 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 ``` -gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive teamdriveparentid 2CY-45G +gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid 2CY-45G ``` You can script the steps: Linux/MacOS ``` 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 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 teamdriveparentid $targetFolderId +targetFolderId=$(gam user user@domain.com create drivefile mimetype gfolder shareddriveparentid 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 ``` Windows PowerShell ``` 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 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 teamdriveparentid $targetFolderId +$targetFolderId = & gam user user@domain.com create drivefile mimetype gfolder shareddriveparentid 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 ``` Windows Command Prompt ``` 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 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 teamdriveparentid %targetFolderId% +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 +gam redirect stdout ./CopySharedDrive.txt multiprocess redirect stderr stdout csv TopSDItems.csv gam user user@domain.com copy drivefile "~id" recursive shareddriveparentid %targetFolderId% ``` ## Move files and folders @@ -614,10 +614,10 @@ This is the default mode. * `parentid ` - The target folder is identified by `` which must be writable by ``. * `parentname ` - A search is performed for a folder named `` owned by ``. * `anyownerparentname ` - A search is performed for a folder named `` owned by any user but must be writable by ``. -* `teamdriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder. -* `teamdriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. -* `teamdriveparentid teamdriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. -* `teamdriveparent teamdriveparentname ` - A Shared Drive name and a folder name on that Shared Drive. +* `shareddriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specific Shared Drive folder. +* `shareddriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. +* `shareddriveparentid shareddriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. +* `shareddriveparent shareddriveparentname ` - 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. ### Duplicate files @@ -761,14 +761,14 @@ The following command will change the parents of the top level files and folders * No permissions are processed. ``` -gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX mergewithparent +gam user user@domain.com move drivefile shareddriveid 0AC_1AB shareddriveparentid 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. The folder on the target Shared Drive will have the same name as the name of the source Shared Drive; use the `newfilename ` to use a different name. ``` -gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX -gam user user@domain.com move drivefile teamdriveid 0AC_1AB teamdriveparentid 0AE_9ZX newfilename "Copy of source Shared Drive" +gam user user@domain.com move drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX +gam user user@domain.com move drivefile shareddriveid 0AC_1AB shareddriveparentid 0AE_9ZX newfilename "Copy of source Shared Drive" ``` ### Inter-workspace moves @@ -778,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. ``` -$ gam user user@domaina move drivefile teamdriveid teamdriveparentid mergewithparent +$ gam user user@domaina move drivefile shareddriveid shareddriveparentid mergewithparent User: user@domaina.com, Move 1 Drive File/Folder User: user@domaina.com, Drive Folder: Shared Drive A(), Move(Merge) contents with Drive Folder: Shared Drive B() User: user@domaina.com, Drive File: Filename(), Move Failed: Bad Request. User message: "shareOutNotPermitted" @@ -794,13 +794,13 @@ The following command will change the parents of the top level files and folders * No permissions are processed. ``` -gam user user@domain.com move drivefile teamdriveid 0AC_1AB parentid root mergewithparent +gam user user@domain.com move drivefile shareddriveid 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. The folder on the My Drive will have the same name as the name of the Shared Drive; use the `newfilename ` to use a different name. ``` -gam user user@domain.com move drivefile teamdriveid 0AC_1AB parentid root -gam user user@domain.com move drivefile teamdriveid 0AC_1AB parentid root newfilename "Copy of Shared Drive" +gam user user@domain.com move drivefile shareddriveid 0AC_1AB parentid root +gam user user@domain.com move drivefile shareddriveid 0AC_1AB parentid root newfilename "Copy of Shared Drive" ``` diff --git a/wiki/Users-Drive-Files-Display.md b/wiki/Users-Drive-Files-Display.md index d27bd812..d2982e45 100644 --- a/wiki/Users-Drive-Files-Display.md +++ b/wiki/Users-Drive-Files-Display.md @@ -65,9 +65,9 @@ ::= ::= - ::= (teamdriveid ) | (teamdriveid:) - ::= (teamdrive ) | (teamdrive:) - ::= (teamdrivefilename ) | (teamdrivefilename:) + ::= (shareddriveid ) | (shareddriveid:) + ::= (shareddrive ) | (shareddrive:) + ::= (shareddrivefilename ) | (shareddrivefilename:) ::= | @@ -315,8 +315,8 @@ size| spaces| starred| - teamdriveid| - teamdrivename| + shareddriveid| + shareddrivename| thumbnaillink| thumbnailversion| title| diff --git a/wiki/Users-Drive-Files-Manage.md b/wiki/Users-Drive-Files-Manage.md index 26d6dce6..ad0f6690 100644 --- a/wiki/Users-Drive-Files-Manage.md +++ b/wiki/Users-Drive-Files-Manage.md @@ -149,10 +149,10 @@ (parentid )| (parentname )| (anyownerparentname )| - (teamdriveparentid )| - (teamdriveparent )| - (teamdriveparentid teamdriveparentname )| - (teamdriveparent teamdriveparentname ) + (shareddriveparentid )| + (shareddriveparent )| + (shareddriveparentid shareddriveparentname )| + (shareddriveparent shareddriveparentname ) ::= | @@ -196,10 +196,10 @@ You can specify where the new file is to be located: * `parentid ` - Folder ID. * `parentname ` - Folder name; the folder must be owned by ``. * `anyownerparentname ` - Folder name; the folder can be owned by any user, `` must be able to write to the folder. -* `teamdriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. -* `teamdriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. -* `teamdriveparentid teamdriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. -* `teamdriveparent teamdriveparentname ` - A Shared Drive name and a folder name on that Shared Drive. +* `shareddriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. +* `shareddriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. +* `shareddriveparentid shareddriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. +* `shareddriveparent shareddriveparentname ` - 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. 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 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. -Sustitute for admin@domain.com and ``. +Sustitute for admin@domain.com and ``. ``` Students.csv primaryEmail,Name @@ -299,7 +299,7 @@ mary@domain.com, Mary Smith ... # 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 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 csv addcsvdata primaryEmail "~primaryEmail" # 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 # 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 ``` -gam user user@domain.com create drivefolderpath path "Top Folder/Middle Folder/Bottom Folder/Sub Folder" teamdriveparent "TS Shared Drive" teamdriveparentname "TS SD6 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" 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... 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 ` - Folder ID. * `parentname ` - Folder name; the folder must be owned by ``. * `anyownerparentname ` - Folder name; the folder can be owned by any user, `` must be able to write to the folder. -* `teamdriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. -* `teamdriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. -* `teamdriveparentid teamdriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. -* `teamdriveparent teamdriveparentname ` - A Shared Drive name and a folder name on that Shared Drive. +* `shareddriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. +* `shareddriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. +* `shareddriveparentid shareddriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. +* `shareddriveparent shareddriveparentname ` - A Shared Drive name and a folder name on that Shared Drive. You can add/remove parent folders without affecting other parent folders. * `addparents|removeparents ` - Specify the parent folders by ID. diff --git a/wiki/Users-Drive-Ownership.md b/wiki/Users-Drive-Ownership.md index 14257a99..e7991b31 100644 --- a/wiki/Users-Drive-Ownership.md +++ b/wiki/Users-Drive-Ownership.md @@ -30,13 +30,13 @@ (parentid )| (parentname )| (anyownerparentname )| - (teamdriveparentid )| - (teamdriveparent )| - (teamdriveparentid teamdriveparentname )| - (teamdriveparent teamdriveparentname ))| - (teamdriveparentid )|(teamdriveparent )| - (teamdriveparentid teamdriveparentname )| - (teamdriveparent teamdriveparentname ) + (shareddriveparentid )| + (shareddriveparent )| + (shareddriveparentid shareddriveparentname )| + (shareddriveparent shareddriveparentname ))| + (shareddriveparentid )|(shareddriveparent )| + (shareddriveparentid shareddriveparentname )| + (shareddriveparent shareddriveparentname ) ::= createddate|createdtime| diff --git a/wiki/Users-Drive-Permissions.md b/wiki/Users-Drive-Permissions.md index 6129e76a..b365ee4e 100644 --- a/wiki/Users-Drive-Permissions.md +++ b/wiki/Users-Drive-Permissions.md @@ -357,8 +357,8 @@ The `quotechar ` 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: ``` -gam redirect csv ./TeamDrives.csv print teamdrives -gam redirect csv ./TeamDriveACLs.csv multiprocess csv ./TeamDrives.csv gam print drivefileacls teamdriveid "~id" addtitle "~name" fields id,domain,emailaddress,role,type,deleted +gam redirect csv ./SharedDrives.csv print shareddrives +gam redirect csv ./SharedDriveACLs.csv multiprocess csv ./SharedDrives.csv gam print drivefileacls shareddriveid "~id" addtitle "~name" fields id,domain,emailaddress,role,type,deleted ``` ## Delete all ACLs except owner from a file diff --git a/wiki/Users-Drive-Shortcuts.md b/wiki/Users-Drive-Shortcuts.md index 70ca6d8c..c1231e32 100644 --- a/wiki/Users-Drive-Shortcuts.md +++ b/wiki/Users-Drive-Shortcuts.md @@ -26,10 +26,10 @@ (parentid )| (parentname )| (anyownerparentname )| - (teamdriveparentid )| - (teamdriveparent )| - (teamdriveparentid teamdriveparentname )| - (teamdriveparent teamdriveparentname ) + (shareddriveparentid )| + (shareddriveparent )| + (shareddriveparentid shareddriveparentname )| + (shareddriveparent shareddriveparentname ) ``` ## Create shortcuts @@ -48,10 +48,10 @@ There are two modes of operaton: * `parentid ` - Folder ID. * `parentname ` - Folder name; the folder must be owned by ``. * `anyownerparentname ` - Folder name; the folder can be owned by any user, `` must be able to write to the folder. - * `teamdriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. - * `teamdriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. - * `teamdriveparentid teamdriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. - * `teamdriveparent teamdriveparentname ` - A Shared Drive name and a folder name on that Shared Drive. + * `shareddriveparentid ` - Shared Drive folder ID; when used alone, this indicates a specfic Shared Drive folder. + * `shareddriveparent ` - Shared Drive name; when used alone, this indicates the root level of the Shared Drive. + * `shareddriveparentid shareddriveparentname ` - A Shared Drive ID and a folder name on that Shared Drive. + * `shareddriveparent shareddriveparentname ` - A Shared Drive name and a folder name on that Shared Drive. * `convertparents` - Convert all but the last parent reference in `` 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 `` 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 ``` -gam redirect csv ./TDShortcuts.csv user organizer@domain.com print filelist select teamdriveid showmimetype gshortcut fields id +gam redirect csv ./TDShortcuts.csv user organizer@domain.com print filelist select shareddriveid showmimetype gshortcut fields id gam redirect csv ./Shortcuts.csv user organizer@domain.com check drivefileshortcut csvfile TDShortcuts.csv:id csv ``` diff --git a/wiki/Users-Shared-Drives.md b/wiki/Users-Shared-Drives.md index c704c7e9..8c22cb1b 100644 --- a/wiki/Users-Shared-Drives.md +++ b/wiki/Users-Shared-Drives.md @@ -148,6 +148,8 @@ | + ::= See: https://developers.google.com/workspace/drive/api/guides/search-shareddrives + ::= manager|organizer|owner| contentmanager|fileorganizer| @@ -159,8 +161,8 @@ ::= ::= | - (teamdriveid )|(teamdriveid:)| - (teamdrive )|(teamdrive:) + (shareddriveid )|(shareddriveid:)| + (shareddrive )|(shareddrive:) ::= backgroundimagefile| @@ -174,10 +176,10 @@ themeid ::= "(,)*" - ::= (teamdriveid ) | (teamdriveid:) - ::= (teamdrive ) | (teamdrive:) - ::= (teamdrivefilename ) | (teamdrivefilename:) - ::= (teamdrivequery ) | (teamdrivequery:) + ::= (shareddriveid ) | (shareddriveid:) + ::= (shareddrive ) | (shareddrive:) + ::= (shareddrivefilename ) | (shareddrivefilename:) + ::= (shareddrivequery ) | (shareddrivequery:) ::= all_files | all_folders | all_google_files | all_non_google_files | all_items @@ -291,11 +293,11 @@ When either of these options is chosen, no infomation about Shared Drive restric To retrieve the Shared Drive ID with `returnidonly`: ``` Linux/MacOS -teamDriveId=$(gam user user@domain.com create shareddrive ... returnidonly) +shareddriveId=$(gam user user@domain.com create shareddrive ... returnidonly) Windows PowerShell -$teamDriveId = & gam user user@domain.com create shareddrive ... returnidonly +$shareddriveId = & gam user user@domain.com create shareddrive ... returnidonly Windows Command Prompt -for /f "delims=" %a in ('gam user user@domain.com create shareddrive ... returnidonly') do set teamDriveId=%a +for /f "delims=" %a in ('gam user user@domain.com create shareddrive ... returnidonly') do set shareddriveId=%a ``` ## Bulk Create Shared Drives @@ -417,12 +419,12 @@ The `quotechar ` option allows you to choose an alternate quote chara Display the number of Shared Drives. ``` gam show|print shareddrives - [teamdriveadminquery|query ] + [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] showitemcountonly ``` By default, all Shared Drives are counted; use the following options to select a subset of Shared Drives: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `matchname ` - Retrieve Shared Drives with names that match a pattern. * `orgunit|org|ou ` - Only Shared Drives in the specified Org Unit are selected @@ -466,7 +468,7 @@ Options `shareddriveadminquery|query` and `shareddrives|teamdrives` are mutually 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: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `shareddrives|teamdrives ` - Select the Shared Drive IDs specified in `` * `shareddrives|teamdrives select |` - Select the Shared Drive IDs specified in `|` * `orgunit|org|ou ` - Only Shared Drives in the specified Org Unit are selected @@ -486,7 +488,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: ``` -gam redirect csv ./TeamDriveOrganizers.csv print shareddriveorganizers +gam redirect csv ./ShareddriveOrganizers.csv print shareddriveorganizers ``` ## Manage Shared Drive access @@ -596,14 +598,14 @@ The `quotechar ` option allows you to choose an alternate quote chara ## Display Shared Drive access for selected Shared Drives ``` gam show shareddriveacls - adminaccess [teamdriveadminquery|query ] + adminaccess [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] [user|group [checkgroups]] (role|roles )* * [] [pmselect] [oneitemperrow] [*|(fields )] [formatjson [quotechar ]] gam print shareddriveacls [todrive *] - adminaccess [teamdriveadminquery|query ] + adminaccess [shareddriveadminquery|query ] [matchname ] [orgunit|org|ou ] [user|group [checkgroups]] (role|roles )* * [] [pmselect] @@ -615,7 +617,7 @@ Shared Drives in the workspace, `` should specify a super admin option shoud be used. By default, all Shared Drives are displayed; use the following options to select a subset of Shared Drives: -* `teamdriveadminquery|query ` - Use a query to select Shared Drives +* `shareddriveadminquery|query ` - Use a query to select Shared Drives * `matchname ` - Retrieve Shared Drives with names that match a pattern. * `orgunit|org|ou ` - Only Shared Drives in the specified Org Unit are selected * `* [] pmselect` - Use permission matching to select Shared Drives