Need to apply Google Drive label to unlabeled files in specific folder

122 views
Skip to first unread message

Henry Blanchard

unread,
Jan 25, 2024, 12:14:44 PM1/25/24
to GAM for Google Workspace
I have around 110,000 files in a specific folder on a shared drive that need to have a label applied. Some files have already had the label manually applied but most have not. I'm trying to get a list of the files that do not have the label applied and then apply the label to those files.

Can this be done in one step? So far the this is what I've tried but I'm getting an error message. I realize that even if this was working it would only get me half way through what I want to accomplish.

gam redirect csv ./FileList.csv user ...@domain.com print filelist query "'FOLDER_ID' in parents and not 'labels/LABEL_ID' in labels" fields id,name filepath

Any help or assistance will be greatly appreciated.

Thanks,
Henry Blanchard

Brian Kim

unread,
Jan 25, 2024, 12:19:15 PM1/25/24
to GAM for Google Workspace
What error are you getting, and what version of GAM are you using?

Henry Blanchard

unread,
Jan 25, 2024, 12:35:21 PM1/25/24
to GAM for Google Workspace
GAMADV-XTD3 6.67.19

Here's what I get.

Getting all Drive Files/Folders that match query ('me' in owners and ('FOLDER_ID in parents and not 'labels/LABEL_ID' in labels)) for ...@domain.com
User:  ...@domain.com, Drive File Print Failed: Query ('me' in owners and ('FOLDER_ID' in parents and not 'labels/LABEL_ID' in labels)) Invalid


Ross Scroggs

unread,
Jan 25, 2024, 12:42:37 PM1/25/24
to google-ap...@googlegroups.com
There must be a subtle quoting issue, send me a Meet/Zoom invitation.

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.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/a755454a-57aa-49af-b35c-76db2e5da1f0n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages