Combining Query Strings in GAM

166 views
Skip to first unread message

Mark Pout

unread,
May 6, 2020, 9:28:52 AM5/6/20
to GAM for G Suite
Hi Everyone wonder if you can shed any light on a script im working on.

gam users all users print filelist todrive query title = ‘.DS_Store’” query name contains 03 PROJECTS’” allfields

in short, I’m trying to get a list of all files in the 03 PROJECTS shared drive with the title DS_Store and eventually delete them. I haven't got to the deleting part yet but so far I’m having issues combining 2 queries into one string? what am I doing wrong?! 

I keep getting the error
ERROR: name contains '03 projects' is not a valid argument for "gam <users> show filelist"

I'm pretty sure the second query, 'name contains' is wrong. First time poster so apologies if this is a common question, I couldn't see it anywhere 

Thanks

M

Ross Scroggs

unread,
May 6, 2020, 10:16:48 AM5/6/20
to google-ap...@googlegroups.com
Mark,

You're using Standard GAM and this is not easy/possible as far as I know.

With Advanced GAM (https://github.com/taers232c/GAMADV-XTD3) this is easy.

gam user tdorg...@domain.com print filelist select teamdrive "03 Projects" query "title = '.DS_Store'" allfields

Replace tdorg...@domain.com with a valid organizer for Shared Drive 03 Projects.

Why are yiu using allfields? What are you trying to achieve? If it's to delete these files then replace allfields with fields id.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/e6915d87-770b-4462-9c8a-92b34944fe48%40googlegroups.com.

Message has been deleted

Mark Pout

unread,
May 6, 2020, 11:07:27 AM5/6/20
to GAM for G Suite
Wow fast response! Thanks!

I'll give that a go now. No massive reason for the allfields argument, just wanted to see what I got back (answer; too much information ;-) ) Once I have that i want to check through the list, make sure it's all stuff I want to delete and then delete it. But one step at a time!

Great tool BTW, thank you! I can only imagine the hours that went into the installation scripts, creating projects etc! amazing work!

Thanks

M
Reply all
Reply to author
Forward
0 new messages