Possible to view filters and for the Group user query to pull disabled/suspended users

726 views
Skip to first unread message

Andrew Moore

unread,
Feb 10, 2015, 11:41:44 AM2/10/15
to google-ap...@googlegroups.com
I know I can create Filters, but is it possible to view the filters a user has?

Also, when I run the group print query to see the list of users, it does not display users that are suspended or disabled in Google, is their a command to force those users to return so I can remove those users from the group?

Ullfig, Roberto Alfredo

unread,
Aug 25, 2016, 11:56:56 AM8/25/16
to google-ap...@googlegroups.com

No response the first time. Is this possible? We are dealing with some users who have had their accounts hacked and filters modified. If we could see these filters it would help in solving issues related to the hack.

 

---

Roberto Ullfig – rul...@uic.edu

ACCC Research Programmer

--
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/cd42ade6-19e7-482b-95e2-f801e7719843%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ross Scroggs

unread,
Aug 25, 2016, 12:03:14 PM8/25/16
to google-ap...@googlegroups.com

Jay Lee

unread,
Aug 25, 2016, 12:04:48 PM8/25/16
to google-ap...@googlegroups.com
This is now possible with GAM 3.7 and the new Gmail Settings API. Try:

gam user goth...@example.com print filters todrive

you can replace "user <email>" with "all users" to get filters across all your users but that will mean an API call per-user which will take awhile.

Jay


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

Jay

Frank Barton

unread,
Aug 25, 2016, 2:28:50 PM8/25/16
to google-ap...@googlegroups.com
running 3.71 against myself (and I have plenty of filters) this doesn't work

python gam.py user bar...@husson.edu print filters todrive

User: bar...@husson.edu, Does not exist

User: bar...@husson.edu, Does not exist

GAM 3.71 - http://git.io/gam

Jay Lee <jay...@gmail.com>

Python 2.7.6 64-bit final

google-api-python-client 1.5.1

Linux-3.13.0-32-generic-x86_64-with-Ubuntu-14.04-trusty x86_64

Path: /home/gapps/GAM-3.71/src


Usage: gam [OPTIONS]...


GAM. Retrieve or set Google Apps domain,

user, group and alias settings. Exhaustive list of commands

can be found at: https://github.com/jay0lee/GAM/wiki


Examples:

gam info domain

gam create user jsmith firstname John lastname Smith password secretpass

gam update user jsmith suspended on

gam.exe update group announcements add member jsmith

...




Also, if I omit the todrive, I get 

User: bar...@husson.edu, Does not exist

User: bar...@husson.edu, Does not exist

User,id



Frank


On Thu, Aug 25, 2016 at 12:04 PM, Jay Lee <jay...@gmail.com> wrote:
This is now possible with GAM 3.7 and the new Gmail Settings API. Try:

gam user goth...@example.com print filters todrive

you can replace "user <email>" with "all users" to get filters across all your users but that will mean an API call per-user which will take awhile.

Jay
On Thu, Aug 25, 2016 at 11:56 AM Ullfig, Roberto Alfredo <rul...@uic.edu> wrote:

No response the first time. Is this possible? We are dealing with some users who have had their accounts hacked and filters modified. If we could see these filters it would help in solving issues related to the hack.

 

---

Roberto Ullfig – rul...@uic.edu

ACCC Research Programmer

 

From: google-apps-manager@googlegroups.com [mailto:google-apps-manager@googlegroups.com] On Behalf Of Andrew Moore
Sent: Tuesday, February 10, 2015 10:42 AM
To: google-apps-manager@googlegroups.com
Subject: [GAM] Possible to view filters and for the Group user query to pull disabled/suspended users

 

I know I can create Filters, but is it possible to view the filters a user has?

 

Also, when I run the group print query to see the list of users, it does not display users that are suspended or disabled in Google, is their a command to force those users to return so I can remove those users from the group?

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

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

Jay

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



--
Frank Barton
ACMT
IT Systems Administrator
Husson University

Jay Lee

unread,
Aug 25, 2016, 2:46:56 PM8/25/16
to google-ap...@googlegroups.com
Make sure you have authorized your service account for all of the scopes listed at:


GAM 3.7+ uses the new Gmail Settings API which adds two new scopes for operations like print filters:


It's necessary to re-enter ALL of the scopes when authorizing the account.

Jay

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.

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

Jay

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

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



--
Frank Barton
ACMT
IT Systems Administrator
Husson University

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

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

Jay

Ullfig, Roberto Alfredo

unread,
Aug 25, 2016, 4:24:53 PM8/25/16
to google-ap...@googlegroups.com

Did the URL change? I have this marked:

 

https://console.developers.google.com/project

 

But I can’t see the breakdown of existing APIs we’ve enabled. Can’t we just edit an existing project?

 

---

Roberto Ullfig – rul...@uic.edu

ACCC Research Programmer

 

Ross Scroggs

unread,
Aug 25, 2016, 4:32:40 PM8/25/16
to google-ap...@googlegroups.com

You don't need to go to the developers site, just log on to your Google Admin console.


To use this version, you must update the list of authorized scopes for your Gam OAuth2 Client and Service Account.

Go here: https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile

Log on to the admin console as in steps 6.ii.c, d, e.

In the list of Authorized API clients, locate your Gam OAuth2 Client, copy the Client ID and then remove the entry.

Paste the Client ID into the Client name box as in step 6.ii.f, then do steps 6.ii.g and 6.ii.h.

You'll notice that the API Scopes - OAuth2 list has additional entries, these are what is required in Gam 3.7.

Skip down to step 6.iii.

In the list of Authorized API clients, locate your Gam Service Account, copy the Client ID and then remove the entry.

Paste the Client ID into the Client name box as in step 6.iii.c, then do steps 6.iii.d and 6.iii.e.

You'll notice that the API Scopes - Service Account list has additional entries, these are what is required in Gam 3.7.


Ross

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.

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

--

Jay

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



 

--

Frank Barton

ACMT

IT Systems Administrator

Husson University

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

--

Jay

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

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



--

Ullfig, Roberto Alfredo

unread,
Aug 26, 2016, 8:51:15 AM8/26/16
to google-ap...@googlegroups.com

Thanks for your assistance – however in 6.ii.g where it says:

 

“select the entire list of API scopes - OAuth2 below, copy it (Control/Command-C) and paste it into the field labeled One or More API Scopes on the Admin Console screen”

 

I don’t see anything “below” to copy and paste.

 

---

Roberto Ullfig – rul...@uic.edu

ACCC Research Programmer

 

From: google-ap...@googlegroups.com [mailto:google-ap...@googlegroups.com] On Behalf Of Ross Scroggs
Sent: Thursday, August 25, 2016 3:33 PM
To: google-ap...@googlegroups.com
Subject: Re: [GAM] Possible to view filters and for the Group user query to pull disabled/suspended users

 

You don't need to go to the developers site, just log on to your Google Admin console.

 

To use this version, you must update the list of authorized scopes for your Gam OAuth2 Client and Service Account.

Go here: https://github.com/jay0lee/GAM/wiki/CreatingClientSecretsFile

Log on to the admin console as in steps 6.ii.c, d, e.

In the list of Authorized API clients, locate your Gam OAuth2 Client, copy the Client ID and then remove the entry.

Paste the Client ID into the Client name box as in step 6.ii.f, then do steps 6.ii.g and 6.ii.h.

You'll notice that the API Scopes - OAuth2 list has additional entries, these are what is required in Gam 3.7.

Skip down to step 6.iii.

In the list of Authorized API clients, locate your Gam Service Account, copy the Client ID and then remove the entry.

Paste the Client ID into the Client name box as in step 6.iii.c, then do steps 6.iii.d and 6.iii.e.

You'll notice that the API Scopes - Service Account list has additional entries, these are what is required in Gam 3.7.

 

Ross

On Thu, Aug 25, 2016 at 1:24 PM, Ullfig, Roberto Alfredo <rul...@uic.edu> wrote:

Did the URL change? I have this marked:

 

https://console.developers.google.com/project

 

But I can’t see the breakdown of existing APIs we’ve enabled. Can’t we just edit an existing project?

 

---

Roberto Ullfig – rul...@uic.edu

ACCC Research Programmer

 

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.

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

--

Jay

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


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



 

--

Frank Barton

ACMT

IT Systems Administrator

Husson University

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

--

Jay

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

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



 

--

Ross Scroggs

--

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.

Ross Scroggs

unread,
Aug 26, 2016, 8:56:09 AM8/26/16
to google-ap...@googlegroups.com

Ullfig, Roberto Alfredo

unread,
Aug 26, 2016, 8:58:41 AM8/26/16
to google-ap...@googlegroups.com

Ah right, I thought “below” meant within the admin api interface. I kind of expected to be able to select them there.

Samuel

unread,
Aug 29, 2016, 12:05:43 PM8/29/16
to Google Apps Manager
Hello, could you please add the retrieve filters command in the wiki, my english is not good enough

gam user gothacked@example.com print filters [todrive]

In future releases is it possible to always put the same header, when I run the command for two different users I got

User,id,archive,from,label,markread,neverspam,query,subject,to,trash
User,id,forward,from,markread,neverspam,subject



Thank you

Samuel

unread,
Aug 30, 2016, 10:01:46 AM8/30/16
to Google Apps Manager
To who this may help

retrieve filters
gam user <email> print|show filters [todrive]
print for csv like output
show for screen output

delete filters
gam user <email> delete filters <id filter>


Frank Barton

unread,
Sep 2, 2016, 3:23:11 PM9/2/16
to google-ap...@googlegroups.com
Folks, I was able to get individual filters working (thank you all very much)
but when I try to do an all users, here is what I get

gapps@Little:~/GAM-current$ python gam.py all users print filters todrive
Getting all users in Google Apps account (may take some time on a large account)...
Got 11998 users...
done getting 10996 users.
Traceback (most recent call last):
  File "gam.py", line 11234, in <module>
    sys.exit(ProcessGAMCommand(sys.argv))
  File "gam.py", line 11003, in ProcessGAMCommand
    printShowFilters(users, True)
  File "gam.py", line 5925, in printShowFilters
    row = _printFilter(user, userFilter, labels)
  File "gam.py", line 5722, in _printFilter
    for labelId in userFilter[u'action'].get(u'addLabelIds', []):
KeyError: u'action'

Any thoughts? 

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

Ross Scroggs

unread,
Sep 2, 2016, 3:30:06 PM9/2/16
to google-ap...@googlegroups.com
Frank,

The error (which I'll fix) indicates that you have a filter with no actions; gam won't let you make such a filter. Are these existing filters or were they created by some other mechanism?

Ross

On Fri, Sep 2, 2016 at 12:23 PM, Frank Barton <bar...@husson.edu> wrote:
Folks, I was able to get individual filters working (thank you all very much)
but when I try to do an all users, here is what I get

gapps@Little:~/GAM-current$ python gam.py all users print filters todrive
Getting all users in Google Apps account (may take some time on a large account)...
Got 11998 users...
done getting 10996 users.
Traceback (most recent call last):
  File "gam.py", line 11234, in <module>
    sys.exit(ProcessGAMCommand(sys.argv))
  File "gam.py", line 11003, in ProcessGAMCommand
    printShowFilters(users, True)
  File "gam.py", line 5925, in printShowFilters
    row = _printFilter(user, userFilter, labels)
  File "gam.py", line 5722, in _printFilter
    for labelId in userFilter[u'action'].get(u'addLabelIds', []):
KeyError: u'action'

Any thoughts? 
On Tue, Aug 30, 2016 at 10:01 AM, Samuel <samuel.sobrino@graduateinstitute.ch> wrote:
To who this may help

retrieve filters
gam user <email> print|show filters [todrive]
print for csv like output
show for screen output

delete filters
gam user <email> delete filters <id filter>


--
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-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
--
Frank Barton
ACMT
IT Systems Administrator
Husson University

--
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.
Visit this group at https://groups.google.com/group/google-apps-manager.

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



--

Frank Barton

unread,
Sep 2, 2016, 4:05:29 PM9/2/16
to google-ap...@googlegroups.com
We have not created any filters through GAM, these would all be filters that users created on their own

Frank




--

--
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.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages