syntax error?

117 views
Skip to first unread message

David Neff

unread,
Oct 4, 2021, 9:21:56 PM10/4/21
to GAM for Google Workspace

I took this one out of the GAM Cheat Sheet and only had to change the path. It seems my path is correct as it's returning emails but what's with no such user or named directory? Isn't that a google default name, "primaryEmail" Where would I find it if other?


David-Neff ~ % gam print users query "orgUnitPath='/Suspended Users/Former Staff' issuspended=false" | gam csv -gam update user ~primaryEmail suspended on 

zsh: no such user or named directory: primaryEmail

David-Neff ~ % Getting all Users in Google Workspace account that match query (orgUnitPath='/Suspended Users/Former Staff' issuspended=false) (may take some time on a large account)...

Got 3 Users: char...@Xschool.org - tay...@Xschool.org

Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>

BrokenPipeError: [Errno 32] Broken pipe

Ross Scroggs

unread,
Oct 4, 2021, 9:32:32 PM10/4/21
to google-ap...@googlegroups.com
David,

Put ~primaryEmail in ", there should be a space between - and gam.
gam print users query "orgUnitPath='/Suspended Users/Former Staff' issuspended=false" | gam csv - gam update user "~primaryEmail" suspended on 

David Neff

unread,
Oct 5, 2021, 9:31:10 AM10/5/21
to GAM for Google Workspace
Thanks Ross, saved me another hour of banging my head on the desk! So simple yet... so....
Reply all
Reply to author
Forward
0 new messages