How do you Suspend User Accounts in GAM?

12,457 views
Skip to first unread message

Bruce Selzler

unread,
Jun 10, 2014, 11:09:56 AM6/10/14
to google-ap...@googlegroups.com
Hello Team,

I've been searching for a solution as to how to suspend user accounts en masse using Gam.  Im on a Mac so I need to use Python.  The explanations I've found so far either don't seem to work or are so incomplete that I can't work it out.

Any help here would be appreciated.

Thanks.

- Sez

Jay Lee

unread,
Jun 10, 2014, 11:18:09 AM6/10/14
to google-ap...@googlegroups.com
Make sure you're using the latest 3.2 release and try:

gam csv myfile.csv gam update user ~Email suspended on

this assumes you've created myfile.csv with a header of "Email" and the email addresses of accounts to be suspended. You could generate that list dynamically also:

gam print users query "orgUnitPath='/Students/2014'" | gam csv - gam update user ~Email suspended on

the first part of the command (gam print) will generate a CSV of just the users underneath the /Students/2014 OU (note the double quotes around the whole filter while single quotes around the OU).

The CSV output is immediately piped into the 2nd GAM command which works identical to my first example above to suspend those students.



Jay Lee


--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/4c99dc12-e0c3-4692-8bf4-2f636bfd4f34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Edward Crist

unread,
Jun 10, 2014, 11:32:19 AM6/10/14
to google-ap...@googlegroups.com
Hey!  I've got several dozen suspended accounts.  Is there a GAM command that will find them and delete them all at once?

Thanks!



Edward Crist
Technology Manager
City Charter High School

201 Stanwix St.
Pittsburgh, PA 15222


On Tue, Jun 10, 2014 at 11:09 AM, Bruce Selzler <bruce....@sesd.org> wrote:

--

Jay Lee

unread,
Jun 10, 2014, 11:37:20 AM6/10/14
to google-ap...@googlegroups.com
Try:

gam print users query "isSuspended=true"

if that looks like an acceptable list of users to get rid of, you can run:

gam print users query "isSuspended=true" | gam delete user ~Email

for other queries that can be used to limit the list of users returned take a look at:




Jay Lee


Bruce Selzler

unread,
Jun 10, 2014, 11:45:22 AM6/10/14
to google-ap...@googlegroups.com
Jay,

Thank you so much for the explanation.  I was able to make the gam csv myfile.csv gam update user ~Email suspended on work once I changed the csv file to a text file and put single quotes around the text file name as in:

gam csv 'myfile.txt' gam update user ~Email suspended on

I haven't tried changing the first "csv" in the string to txt as I didn't notice and it seems to work anyway.

Im looking forward to trying the mass command, that will really make my life easier.

Thanks again.

- Sez




===========================
Bruce Selzler
Director of Educational
Technology & Student Information
===========================
Please don't print this e-mail.  You already have it!


--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

William

unread,
Jun 20, 2014, 5:09:45 PM6/20/14
to google-ap...@googlegroups.com
Great input, Jay :)


On Tuesday, June 10, 2014 11:18:09 AM UTC-4, Jay Lee wrote:
Make sure you're using the latest 3.2 release and try:

gam csv myfile.csv gam update user ~Email suspended on

this assumes you've created myfile.csv with a header of "Email" and the email addresses of accounts to be suspended. You could generate that list dynamically also:

gam print users query "orgUnitPath='/Students/2014'" | gam csv - gam update user ~Email suspended on

the first part of the command (gam print) will generate a CSV of just the users underneath the /Students/2014 OU (note the double quotes around the whole filter while single quotes around the OU).

The CSV output is immediately piped into the 2nd GAM command which works identical to my first example above to suspend those students.



Jay Lee


On Tue, Jun 10, 2014 at 11:09 AM, Bruce Selzler <bruce....@sesd.org> wrote:
Hello Team,

I've been searching for a solution as to how to suspend user accounts en masse using Gam.  Im on a Mac so I need to use Python.  The explanations I've found so far either don't seem to work or are so incomplete that I can't work it out.

Any help here would be appreciated.

Thanks.

- Sez

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Joey Pistone

unread,
Jul 14, 2014, 1:56:27 PM7/14/14
to google-ap...@googlegroups.com
Heres is what I do.


or

#!/bin/bash
#Suspends user account. I added a "are you sure" option just in case
#########################
 
gam="/path/to/gam/gam.py"
 
GAM_USER=$1
 
if [ -z $GAM_USER ];
then
echo "Usage: $0 <username>"
exit 2
fi
 
read -p "Are you sure you want to suspend $GAM_USER? (Press Y or N) " -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
 
python $gam update user $GAM_USER suspended on
 
 
echo "$GAM_USER has been suspended."


Message has been deleted

jwzg

unread,
Dec 11, 2015, 3:40:33 PM12/11/15
to Google Apps Manager
Getting the following error:

gam print users query "isSuspended=true" | gam delete user ~Email


Getting all users in Google Apps account (may take some time on a large account)...


Deleting account for ~Email@***.com


Error 404: Resource Not Found: userKey - notFound




Got 336 users: ***@***.com - ***@****.com


close failed in file object destructor:


sys.excepthook is missing


lost sys.stderr


What gives?


Jay Lee


- Sez\



Graham Ingleby

unread,
Dec 14, 2015, 5:51:04 AM12/14/15
to GAM group
You need the csv parameter otherwise the command thinks ~email is the username, have a look at https://github.com/jay0lee/GAM/wiki/BulkOperations#bulk-operations-with-gam-32-and-newer


 

 Graham Ingleby | Cloud Computing Consultant | +44 1344 203395 | ging...@ancoris.com

Google+              

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




Jody Barr

unread,
Dec 14, 2015, 9:38:04 AM12/14/15
to google-ap...@googlegroups.com
Got it!  Thanks!
Jody Barr
Director of Technology Integration
Alabama Christian Academy
(334) 277-1985
www.alabamachristian.com


You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

Naomi Doughty

unread,
Jul 12, 2016, 2:12:56 PM7/12/16
to Google Apps Manager
I get this error:
See attached screen shot....

I tried csv instead of txt and same thing...


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.
Screen Shot 2016-07-12 at 2.11.09 PM.png

Bruce Selzler

unread,
Jul 12, 2016, 2:19:19 PM7/12/16
to google-ap...@googlegroups.com
Hello team,

These are the commands I used at the end of the year:



Suspends Accounts Dynamically by Sub Org


Gam print users query “orgUnitPath=’/SSD Students/Class of 2016’” | gam csv gam update user ~primaryEmail Suspended on



Suspends or Activates Accounts by file (note windows txt file, not csv)


gam csv ‘CMSSSemail.txt’ gam update user ~Email Suspended off



I hope this helps.

- Sez


===========================
Bruce Selzler
Director of Educational
Technology & Student Information
===========================
Please don't print this e-mail.  You already have it!


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

Spencer McCulley

unread,
Jul 27, 2016, 4:30:20 PM7/27/16
to Google Apps Manager
Hi all,

Very new to GAM and this is a last minute thing that was sprung on me. I'm using a server with Windows Server 2012 on it. I've tried running the dynamic command "Gam print users query “orgUnitPath=’/OU/Test’” | gam csv gam update user ~primaryEmail Suspended on" but I'm getting the error "Error: header "['primaryEmail']" not found in CSV headers of Email, giving up." I'm not sure what this means or how to fix it. The initial command does show the right range of users, so that's a good thing. If I need to create a .csv or a .txt file of the users that need suspending, how would I go about exporting it out and using it?

Any info and additional troubleshooting would be greatly appreciated. Hopefully I can get this sorted out by Aug. 1st.

Spencer McCulley
Webb City R-7 Schools
District IT Technician
(417)-673-6010 ext.  286 (work)


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

Ross Scroggs

unread,
Jul 27, 2016, 5:02:27 PM7/27/16
to google-ap...@googlegroups.com
Spencer,

I can't duplicate your problem but here is a suggestion that should get you going.
Do: gam print users query “orgUnitPath=’/OU/Test’” 
Verify that you get something like this:

Getting all users in Google Apps account (may take some time on a large account)...

...

There is the primaryEmail header.

Your command should really look like this:
gam print users query “orgUnitPath=’/OU/Test’” | gam csv - gam update user "~primaryEmail" Suspended on

The - after csv says to read from stdin, the command should have blown up without it so I'm assuming that it's a cut/paste problem.
Put quotes around primaryEmail to make sure that the shell doesn't get cute, it does not appear to be so but your error message format doesn't match the code.

Ross



Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--

Spencer McCulley

unread,
Jul 28, 2016, 9:55:33 AM7/28/16
to Google Apps Manager
Awesome, this worked for me. Thanks for the help, Ross.

Spencer McCulley
Webb City R-7 Schools
District IT Technician
(417)-673-6010 ext.  286 (work)


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Julia Harris

unread,
Aug 17, 2016, 12:02:01 PM8/17/16
to Google Apps Manager
I am also new to GAM.  I was able to create users based on a CSV file, but I haven't been able to do suspend users based on OU without a CSV.  I don't really have any experience in DOS language, programming, or using the command prompt, so I'm not sure if I'm just missing something.  I copied the commands directly from your post.

Error when trying to run just a query on an OU:

c:\Users\harrisj\Desktop\gam>gam print users query "orgUnitPath='/Suspended User
s/Staff/Adult'"
Traceback (most recent call last):
  File "<string>", line 9366, in <module>
  File "<string>", line 7615, in doPrintUsers
  File "C:\Users\jlee\Documents\GitHub\gam363\src\build\gam\out00-PYZ.pyz\encodi
ngs.cp437", line 12, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 24-25: c
haracter maps to <undefined>

Trying to run the entire command to suspend users:

c:\Users\harrisj\Desktop\gam>gam print users query "orgUnitPath='/Suspended User
s/Staff/Adult'" | gam csv gam update user ~primaryEmail Suspended on

ERROR: [Errno 2] No such file or directory: u'gam'
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr




Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Ross Scroggs

unread,
Aug 17, 2016, 12:23:42 PM8/17/16
to google-ap...@googlegroups.com
Julia,

A couple of issues here. 

c:\Users\harrisj\Desktop\gam>gam print users query "orgUnitPath='/Suspended Users/Staff/Adult'"
When trying to just do the query, you've got users with extended characters in their name that don't map to to the default Windows character set, Code Page 437 in your case. This is the original DOS character set. In your command window, type: chcp 1252
This will set your code page to 1252 which is compatible with most extend characters.

c:\Users\harrisj\Desktop\gam>gam print users query "orgUnitPath='/Suspended Users/Staff/Adult'" | gam csv gam update user ~primaryEmail Suspended on 
This fails because gam is not on your path. You can enter the full path for the second gam like this:
c:\Users\harrisj\Desktop\gam>gam print users query "orgUnitPath='/Suspended Users/Staff/Adult'" | c:\Users\harrisj\Desktop\gam csv gam update user ~primaryEmail Suspended on

That will get old fast so have a local Windows guru help you put gam on your path.
Control Panel/User Accounts/Change my environment variables.

Ross



Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsubscribe...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Julia Harris

unread,
Aug 17, 2016, 4:26:00 PM8/17/16
to Google Apps Manager
The first command worked perfectly after your suggestion.  Thanks!  The second one did not.  I got the following error:

c:\Users\harrisj\Desktop\gam>gam print users query "orgUnitPath='/Suspended User
s/Staff/Adult'" | c:\Users\harrisj\Desktop\gam csv gam update user ~primaryEmail
 Suspended on
'c:\Users\harrisj\Desktop\gam' is not recognized as an internal or external comm
and,
operable program or batch file.

I was able to copy that list of emails from the query, copy it into a csv then run a command to suspend them that way.  I actually might prefer this because then it gives me a little more control over who gets suspended.  But it would be nice to know what I'm doing wrong.


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

Ross Scroggs

unread,
Aug 17, 2016, 5:12:52 PM8/17/16
to google-ap...@googlegroups.com
Julia,

Too many gams to keep track of: after the | should be: c:\Users\harrisj\Desktop\gam\gam
I was one gam short.
Go to Control Panel, User Accounts, Change my environment variables,
In the User variables box, look for a variable named PATH.
If it exists, click it, then click Edit..., append ';c:\Users\harrisj\Desktop\gam' to it (leave off the quotes), the click OK
If if doesn't exist, click New..., enter PATH in Variable name and 'c:\Users\harrisj\Desktop\gam' in Variable value (no ; and leave off the quotes), click OK
In ether case click OK and exit control panel.
Open a new command window and type: set
You should now see ;c:\Users\harrisj\Desktop\gam at the end of Path and now you can just say gam after the |

Ross



Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsubscribe...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsubscribe...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--

Peter L.

unread,
Jun 12, 2019, 4:43:10 PM6/12/19
to GAM for G Suite
Hi,

When I do a print query

gam print users query "orgUnitPath='/CleverStudents/Weilenmann School of Discovery/8'"

I get a list of users. However, when I add on a command

gam print users query "orgUnitPath='/CleverStudents/Weilenmann School of Discovery/8'" | gam csv - gam update user ~primaryEmail suspended on

I receive errors?

zsh: no such user or named directory: primaryEmail
➜  ~ Getting all Users in G Suite account that match query (orgUnitPath='/CleverStudents/Weilenmann School of Discovery/8') (may take some time on a large account)...
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe

[1]    69979 exit 120   ~/bin/gam/gam print users query

Any help would be greatly appreciated.

Thank you


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Ross Scroggs

Jay Lee

unread,
Jun 12, 2019, 4:47:11 PM6/12/19
to google-ap...@googlegroups.com
What version of GAM are you using? Also, not a big deal but next time start a new thread rather than responding to one from 2016 :-)

Jay



Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Ross Scroggs

--
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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

Ross Scroggs

unread,
Jun 12, 2019, 4:52:03 PM6/12/19
to google-ap...@googlegroups.com
Peter,

zsh is biting you, put ~primaryEmail in "".

gam print users query "orgUnitPath='/CleverStudents/Weilenmann School of Discovery/8'" | gam csv - gam update user "~primaryEmail" suspended on

You can also do: gam ou '/CleverStudents/Weilenmann School of Discovery/8' update user suspended on

Ross



Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

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

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Ross Scroggs

--
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 post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.


--

Peter L.

unread,
Jun 12, 2019, 5:52:04 PM6/12/19
to GAM for G Suite
GAM 4.86


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Ross Scroggs

--
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-manager+unsub...@googlegroups.com.

Peter L.

unread,
Jun 12, 2019, 5:53:19 PM6/12/19
to GAM for G Suite
Thanks Ross! The "~primaryEmail" worked.


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/lsP9mrfPiIQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.



--
Ross Scroggs

--
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-manager+unsub...@googlegroups.com.


--
Ross Scroggs
Reply all
Reply to author
Forward
0 new messages