Removing Users from Shared Drives

238 views
Skip to first unread message

Dale Courtney

unread,
Nov 6, 2023, 9:07:03 PM11/6/23
to GAM for G Suite
I am running GAMADV-XTD3 6.65.06

I would like to remove a user from all company Shared Drives and Shared Files that the user has access to. 

I'm not sure where to start. 

Thanks in advance.

best,

Dale Courtney
Senior IT Manager, Lightcast

232 N. Almon St. | Moscow, ID | 83843

Carlos Landa

unread,
Nov 7, 2023, 6:27:59 AM11/7/23
to GAM for Google Workspace
Hello Dale, I am attaching the link to Ross's documentation that may be of help.

https://sites.google.com/jis.edu.bn/gam-commands/services/shared-team-drive?authuser=0#h.s4xo0s9a0ti:~:text=To%20remove%20a,drivefileacl%20~id%20~User

Here Ross describes the process for removing a user from all possible shared drives.

Carlos L

El dia dimarts, 7 de novembre de 2023 a les 3:07:03 UTC+1, Dale Courtney va escriure:

Dale Courtney

unread,
Nov 7, 2023, 9:23:44 AM11/7/23
to google-ap...@googlegroups.com
Carlos: Thanks so much. That is exactly what I needed. 

best,
Dale


--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/7f38cf55-6417-4545-8ac2-d6d8f1d90813n%40googlegroups.com.

Ross Scroggs

unread,
Nov 7, 2023, 9:47:01 AM11/7/23
to google-ap...@googlegroups.com
Dale,

# Get list of Shared Drives that user can access                                                                                                                                                                                   
# See: https://github.com/taers232c/GAMADV-XTD3/wiki/Shared-Drives#display-shared-drive-access-for-selected-shared-drives                                                                                                          
gam redirect csv ./UserSharedDrives.csv print teamdriveacls user us...@domain.com oneitemperrow

# Delete users's Shared Drive access                                                                                                                                                                                               
# See: https://github.com/taers232c/GAMADV-XTD3/wiki/Shared-Drives#manage-shared-drive-access                                                                                                                                      
gam redirect stdout ./DeleteUserSharedDriveAccess.txt multiprocess redirect stderr stdout csv ./UserSharedDrives.csv gam delete drivefileacl "~id" us...@domain.com

# Get list of files shared to user                                                                                                                                                                                                 
# See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files-Display#file-selection-by-ownership                                                                                                                         
gam redirect csv ./UserFileAccess.csv user us...@domain.com print filelist fields id,name,mimetype,owners.emailaddress showownedby others

# Delete the ACls granting access to the user                                                                                                                                                                                      
# See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Permissions#manage-file-permissionssharing                                                                                                                        
gam redirect stdout ./DeleteUserFileAccess.txt multiprocess redirect stderr stdout csv ./UserFileAccess.csv gam user "~owners.0.emailAddress" delete drivefileacl "~id" us...@domain.com


Ross
----
Ross Scroggs



--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

Dale Courtney

unread,
Nov 7, 2023, 9:51:04 AM11/7/23
to google-ap...@googlegroups.com
Thanks, Ross. You're the best! 

best,
Dale


Reply all
Reply to author
Forward
0 new messages