Preparing to Remove User - Delete all ACLs from Personal Drive?

21 views
Skip to first unread message

Brad Pinkston

unread,
Jun 28, 2024, 10:12:27 PM (4 days ago) Jun 28
to GAM for Google Workspace
I'm prepping to delete an old user account that should have been eliminated a long time ago, but wasnt due to dependence on shares from their personal drive and relocating those files.

How can I go about moving these files?

I'd like to remove all ACLs from all files in their personal drive so I can be made aware of the folks truly using those files in the personal Google Drive.  Any suggestions on this?

Ross Scroggs

unread,
Jun 30, 2024, 10:18:34 PM (2 days ago) Jun 30
to google-ap...@googlegroups.com
Brad,

# Get ACLs for files with sharing enabled
# Replace us...@domain.com with actual user email address
gam redirect csv ./UserSharedFiles.csv user us...@domain.com print filelist fields id,name,mimetype,basicpermissions pm not role owner em pmfilter oneitemperrow

# Notes
redirect csv ./UserSharedFiles.csv - Create a CSV file with the file/folder information
user us...@domain.com - Run the command as the desired user
print filelist fields id,name,mimetype,basicpermissions - Get the file id, name, mimeType and basic permission information
pm not role owner em - Only display files with an ACL other than that of the owner
pmfilter oneitemperrow - Display one row per file/non-owner ACL combination

# Delete the ACLs
gam redirect stdout ./DeleteACLs.txt multiprocess redirect stderr stdout csv UserSharedFiles.csv gam user "~Owner" delete drivefileacl "~id" "id:~~permission.id~~"

# Notes
redirect stdout ./DeleteACLs.txt multiprocess redirect stderr stdout - Log command output
csv UserSharedFiles.csv - Input CSV file
gam user "~Owner" - Run the command as the file owner
delete drivefileacl "~id" "id:~~permission.id~~" - Delete the ACLs

Sources:
https://github.com/taers232c/GAMADV-XTD3/wiki/Bulk-Processing#csv-files-with-redirection-and-select
https://github.com/taers232c/GAMADV-XTD3/wiki/Meta-Commands-and-File-Redirection#file-redirection
https://github.com/taers232c/GAMADV-XTD3/wiki/Permission-Matches
https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files-Display#display-file-list
https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Permissions#manage-file-permissionssharing

Ross

--
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/e9a00c7b-ca99-43db-b8f3-2c0cd5034328n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages