Remove suspended users from all groups

1,720 views
Skip to first unread message

Unhappy Buckaroo

unread,
Aug 16, 2018, 11:53:04 AM8/16/18
to GAM for G Suite
Anyone know whether it's possible to remove users who are in a specific OU from all groups they belong to?

ie. When accounts are suspended for whatever reason, we move them to a "Suspended" OU, and then manually remove their group memberships. This works find during the year, but at year-end when there are dozens of staff accounts being suspended, it would be useful to have a command that would do this.

Alternatively, is there a way to search groups for members whose status is "suspended" and remove/clear those members?

Ross Scroggs

unread,
Aug 16, 2018, 12:13:10 PM8/16/18
to google-ap...@googlegroups.com

The basic command is: gam ou /Suspended delete groups
In standard GAM this makes an API call per user per group.

In my Advanced GAM the API calls are batched and you may have to pace GAM.
gam config batch_size 10 inter_batch_wait 2 ou /Suspended delete groups

Ross


  Find us on Facebook:
  Follow us on Twitter: 

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/c1a29ce1-13ea-4e16-baef-2b14f2c0c8f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Andrew Penner

unread,
Aug 16, 2018, 1:07:54 PM8/16/18
to google-ap...@googlegroups.com
Sweet!
Much better than trying to run gam update group <gr...@domain.com> clear suspended for every group.

______________________________________________________
Andrew Penner, Technical Analyst III (A+, MCP, MCDST)
Office: 780-460-3712 (333)
Mobile:780-913-7576
60 Sir Winston Churchill Ave
St. Albert, AB T8N 0G4




You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/FgwnCdfbhDg/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 https://groups.google.com/group/google-apps-manager.

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

Eric Dannewitz

unread,
Sep 26, 2019, 3:37:06 PM9/26/19
to GAM for G Suite
GAM is the give that keeps giving.......



On Thursday, August 16, 2018 at 9:13:10 AM UTC-7, Ross Scroggs wrote:

The basic command is: gam ou /Suspended delete groups
In standard GAM this makes an API call per user per group.

In my Advanced GAM the API calls are batched and you may have to pace GAM.
gam config batch_size 10 inter_batch_wait 2 ou /Suspended delete groups

Ross

On Thu, Aug 16, 2018 at 8:53 AM Unhappy Buckaroo <andrew...@spschools.org> wrote:
Anyone know whether it's possible to remove users who are in a specific OU from all groups they belong to?

ie. When accounts are suspended for whatever reason, we move them to a "Suspended" OU, and then manually remove their group memberships. This works find during the year, but at year-end when there are dozens of staff accounts being suspended, it would be useful to have a command that would do this.

Alternatively, is there a way to search groups for members whose status is "suspended" and remove/clear those members?



  Find us on Facebook:
  Follow us on Twitter: 

--
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