diff --git a/wiki/GamUpdates.md b/wiki/GamUpdates.md index 6343a918..19ae3438 100644 --- a/wiki/GamUpdates.md +++ b/wiki/GamUpdates.md @@ -10,6 +10,33 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs-GAM7](https://github.com/GAM-team/GAM/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 7.08.00 + +Added the following command that can be used instead of the `GetTeamDriveOrganizers.py` script. + +gam [] print shareddriveorganizers [todrive *] + [adminaccessasadmin] [shareddriveadminquery|query ] + [orgunit|org|ou ] + [matchname ] + [domainlist ] + [includetypes ] + [oneorganizer []] + [shownorganizerdrives [false|true|only]] + [includefileorganizers []] + [delimiter ] +``` +The command defaults match the script defaults: +* `domainlist` - All domains +* `includetypes` - user,groups +* `oneorganizer` - False +* `shownoorganizerdrives` - True +* `includefileorganizers` - False + +For example, to get a single organizer from your domain for all Shared Drives including no organizer drives: +``` +gam redirect csv ./TeamDriveOrganizers.csv print shareddriveorganizers domainlist mydomain.com includetypes user oneorganizer shownoorganizerdrives +``` + ### 7.07.17 Added option `oneuserperrow` to `gam print devices` to have each of a diff --git a/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md b/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md index f8bb534d..8ebd35cb 100644 --- a/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.md +++ b/wiki/How-to-Upgrade-Legacy-GAM-to-GAM7.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 -GAM 7.07.17 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.08.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.3 64-bit final MacOS Sequoia 15.5 x86_64 @@ -989,7 +989,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 -GAM 7.07.17 - https://github.com/GAM-team/GAM - pythonsource +GAM 7.08.00 - https://github.com/GAM-team/GAM - pythonsource GAM Team Python 3.13.3 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/wiki/Shared-Drives.md b/wiki/Shared-Drives.md index cab37d3e..066ef315 100644 --- a/wiki/Shared-Drives.md +++ b/wiki/Shared-Drives.md @@ -15,6 +15,7 @@ - [Display Shared Drive Counts](#display-shared-drive-counts) - [Display List of Shared Drives in an Organizational Unit](#display-list-of-shared-drives-in-an-organizational-unit) - [Display Count of Shared Drives in an Organizational Unit](#display-count-of-shared-drives-in-an-organizational-unit) +- [Display Shared Drive Organizers](#display-shared-drive-organizers) - [Display all Shared Drives with no members](#display-all-shared-drives-with-no-members) - [Display all Shared Drives with no organizers](#display-all-shared-drives-with-no-organizers) - [Display all Shared Drives with a specific organizer](#display-all-shared-drives-with-a-specific-organizer) @@ -153,6 +154,9 @@ withlink ::= "(,)*" + ::= user|group + ::= "(,)*" + ::= See: https://developers.google.com/drive/api/v3/search-parameters ::= manager|organizer|owner| @@ -408,6 +412,36 @@ Print information about Shared Drives that have admin@domain.com as a member. gam user admin@domain.com print teamdrives ``` +## - Display Shared Drive Organizers +The following command can be used instead of the `GetTeamDriveOrganizers.py` script. + +``` +gam [] print shareddriveorganizers [todrive *] + [adminaccessasadmin] [shareddriveadminquery|query ] + [orgunit|org|ou ] + [matchname ] + [domainlist ] + [includetypes ] + [oneorganizer []] + [shownorganizerdrives [false|true|only]] + [includefileorganizers []] + [delimiter ] +``` +For multiple organizers: +* `delimiter ` - Separate `organizers` entries with ``; the default value is `csv_output_field_delimiter` from `gam.cfg`. + +The command defaults match the script defaults: +* `domainlist` - All domains +* `includetypes` - user,groups +* `oneorganizer` - False +* `shownoorganizerdrives` - True +* `includefileorganizers` - False + +For example, to get a single organizer from your domain for all Shared Drives including no organizer drives: +``` +gam redirect csv ./TeamDriveOrganizers.csv print shareddriveorganizers domainlist mydomain.com includetypes user oneorganizer shownoorganizerdrives +``` + ## Display all Shared Drives with no members ``` gam print teamdrives query "memberCount = 0" @@ -795,26 +829,8 @@ gam redirect stdout ./DeleteSharedDrives.txt multiprocess redirect stderr stdout ## Delete old empty Shared Drives ``` -# Get a list of Shared Drives created before one year ago; alter date<-1y as required -gam config csv_output_row_filter "createdTime:date<-1y" redirect csv ./TeamDrives.csv print teamdrives fields id,name,createdtime - -# You'll need a list of Shared Drive IDs and organizers; get ACLs for Shared Drives from above -gam redirect csv ./TeamDriveACLs.csv multiprocess csv ./TeamDrives.csv gam print drivefileacls "~id" fields id,emailaddress,role,type,deleted - -# Customize script: https://github.com/taers232c/GAM-Scripts3/blob/master/GetTeamDriveOrganizers.py -DOMAIN_LIST = ['yourdomain.org'] - -INCLUDE_TYPES = { - 'user': True, - 'group': False, - } - -ONE_ORGANIZER = True -SHOW_NO_ORGANIZER_DRIVES = True -INCLUDE_FILE_ORGANIZERS = False - -# Run script -python GetTeamDriveOrganizers.py TeamDriveACLs.csv TeamDrives.csv TeamDriveOrganizers.csv +# 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 # Inspect TeamDriveOrganizers.csv, you'll have to deal with Shared Drives with no organizer/manager diff --git a/wiki/Users-Shared-Drives.md b/wiki/Users-Shared-Drives.md index 3cf5dd07..dc5cd18b 100644 --- a/wiki/Users-Shared-Drives.md +++ b/wiki/Users-Shared-Drives.md @@ -12,6 +12,7 @@ - [Change Shared Drive visibility](#change-shared-drive-visibility) - [Display Shared Drives](#display-shared-drives) - [Display Shared Drive Counts](#display-shared-drive-counts) +- [Display Shared Drive Organizers](#display-shared-drive-organizers) - [Manage Shared Drive access](#manage-shared-drive-access) - [Display Shared Drive access](#display-shared-drive-access) - [Display Shared Drive access for specific Shared Drives](#display-shared-drive-access-for-specific-shared-drives) @@ -386,6 +387,36 @@ count=$(gam user user@domain.com print shareddrives showitemcountonly) Windows PowerShell count = & gam user user@domain.com print shareddrives showitemcountonly ``` +## - Display Shared Drive Organizers +The following command can be used instead of the `GetTeamDriveOrganizers.py` script. + +``` +gam print shareddriveorganizers [todrive *] + [adminaccessasadmin] [shareddriveadminquery|query ] + [orgunit|org|ou ] + [matchname ] + [domainlist ] + [includetypes ] + [oneorganizer []] + [shownorganizerdrives [false|true|only]] + [includefileorganizers []] + [delimiter ] +``` +For multiple organizers: +* `delimiter ` - Separate `organizers` entries with ``; the default value is `csv_output_field_delimiter` from `gam.cfg`. + +The command defaults match the script defaults: +* `domainlist` - All domains +* `includetypes` - user,groups +* `oneorganizer` - False +* `shownoorganizerdrives` - True +* `includefileorganizers` - False + +For example, to get a single organizer from your domain for all Shared Drives including no organizer drives: +``` +gam redirect csv ./TeamDriveOrganizers.csv print shareddriveorganizers domainlist mydomain.com includetypes user oneorganizer shownoorganizerdrives +``` + ## Manage Shared Drive access These commands must be issued by a user with Shared Drive permission role organizer. ### Process single ACLs. diff --git a/wiki/Version-and-Help.md b/wiki/Version-and-Help.md index 69f3da9b..a37c0a24 100644 --- a/wiki/Version-and-Help.md +++ b/wiki/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAM 7.07.17 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.08.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.3 64-bit final MacOS Sequoia 15.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 -GAM 7.07.17 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.08.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.3 64-bit final MacOS Sequoia 15.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 -GAM 7.07.17 - https://github.com/GAM-team/GAM - pyinstaller +GAM 7.08.00 - https://github.com/GAM-team/GAM - pyinstaller GAM Team Python 3.13.3 64-bit final MacOS Sequoia 15.5 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gam7 Version Check: Current: 5.35.08 - Latest: 7.07.17 + Latest: 7.08.00 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -7.07.17 +7.08.00 ``` 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 7.07.17 - https://github.com/GAM-team/GAM +GAM 7.08.00 - https://github.com/GAM-team/GAM GAM Team Python 3.13.3 64-bit final MacOS Sequoia 15.5 x86_64