Custom schema query not working GAM 4.61

736 views
Skip to first unread message

Raul Molina

unread,
Sep 13, 2018, 1:13:41 PM9/13/18
to GAM for G Suite
Hello

I've created a custom schema using GCDS, this custom schema attribute is replicating properly. When I try to perform a query is never working, I've tried a lot of ways to make this query, for example:

This simple command is working: gam.exe print users custom "pwdLastSet"
This simple command with a query is not working; gam print users full query "pwdLastSet=2018-09-12" 

I'm using:

C:\GAM>gam ?
Python 2.7.15 64-bit final
google-api-python-client 1.7.3
oauth2client 4.1.2
Windows-8.1-6.3.9600 AMD64

Could you please help me
Thanks and regards

Ross Scroggs

unread,
Sep 13, 2018, 1:47:16 PM9/13/18
to google-ap...@googlegroups.com
Raul,

To query based on a schema you have to include the schema name and fieldsname: fullquery  "schemaName:fieldName=2018-09-12"


Ross

--
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/ea31c9b8-5c76-4b7e-b814-cdbea2f38402%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Raul Molina

unread,
Sep 14, 2018, 3:09:58 AM9/14/18
to GAM for G Suite
Hello Ross

I tried many combinations and still not working:

C:\GAM>gam print users full query "customSchemas:pwdLastSet.pwdLastSet=2018-09-12"
Getting all Users in G Suite account that match query (customSchemas:pwdLastSet.pwdLastSet=2018-09-12) (may take some time on a large account)...

ERROR: 400: Invalid Input: customSchemas:pwdLastSet.pwdLastSet=2018-09-12 - invalid

C:\GAM>gam print users full query "customSchemas:pwdLastSet=2018-09-12"
Getting all Users in G Suite account that match query (customSchemas:pwdLastSet=2018-09-12) (may take some time on a large account)...

ERROR: 400: Invalid Input: customSchemas:pwdLastSet=2018-09-12 - invalid

C:\GAM>gam print users full query "pwdLastSet:pwdLastSet=2018-09-12"
Getting all Users in G Suite account that match query (pwdLastSet:pwdLastSet=2018-09-12) (may take some time on a large account)...

ERROR: 400: Invalid Input: pwdLastSet:pwdLastSet=2018-09-12 - invalid

C:\GAM>gam print users fullquery "pwdLastSet:pwdLastSet=2018-09-12"

ERROR: fullquery is not a valid argument for "gam print users"

C:\GAM>gam print users full query "pwdLastSet:pwdLastSet=2018-09-12"
Getting all Users in G Suite account that match query (pwdLastSet:pwdLastSet=2018-09-12) (may take some time on a large account)...

ERROR: 400: Invalid Input: pwdLastSet:pwdLastSet=2018-09-12 - invalid

C:\GAM>gam print users full query "pwdLastSet:pwdLastSet='2018-09-12'"
Getting all Users in G Suite account that match query (pwdLastSet:pwdLastSet='2018-09-12') (may take some time on a large account)...

ERROR: 400: Invalid Input: pwdLastSet:pwdLastSet='2018-09-12' - invalid

C:\GAM>gam print users full query "customSchemas:pwdLastSet='2018-09-12'"
Getting all Users in G Suite account that match query (customSchemas:pwdLastSet='2018-09-12') (may take some time on a large account)...

ERROR: 400: Invalid Input: customSchemas:pwdLastSet='2018-09-12' - invalid



If I run "gam print users full" I see that my attribute or schema is "customSchemas.pwdLastSet.pwdLastSet"

I'm so stuck, Please, could you help me?


Thanks in advance
Regards

On Thursday, 13 September 2018 19:47:16 UTC+2, Ross Scroggs wrote:
Raul,

To query based on a schema you have to include the schema name and fieldsname: fullquery  "schemaName:fieldName=2018-09-12"


Ross

On Thu, Sep 13, 2018 at 10:13 AM Raul Molina <raul....@devoteam.com> wrote:
Hello

I've created a custom schema using GCDS, this custom schema attribute is replicating properly. When I try to perform a query is never working, I've tried a lot of ways to make this query, for example:

This simple command is working: gam.exe print users custom "pwdLastSet"
This simple command with a query is not working; gam print users full query "pwdLastSet=2018-09-12" 

I'm using:

C:\GAM>gam ?
Python 2.7.15 64-bit final
google-api-python-client 1.7.3
oauth2client 4.1.2
Windows-8.1-6.3.9600 AMD64

Could you please help me
Thanks and regards

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


--

Raul Molina

unread,
Sep 14, 2018, 4:56:10 AM9/14/18
to GAM for G Suite
Hello again

In addition, I created the custom schema as follow:

customschema.jpg

Ross Scroggs

unread,
Sep 14, 2018, 9:23:52 AM9/14/18
to google-ap...@googlegroups.com
Raul,

Do: gam show schemas

On Sep 14, 2018, at 1:56 AM, Raul Molina <raul....@devoteam.com> wrote:

Hello again

In addition, I created the custom schema as follow:

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

Ross Scroggs

unread,
Sep 14, 2018, 9:29:09 AM9/14/18
to google-ap...@googlegroups.com
Raul,

$ gam info schema UserInfo
Schema: UserInfo
  displayName: UserInfo
  schemaId: 4pbwfDOUTdWylNArn2-4cw==
  Field: Role
    displayName: Role
    fieldType: STRING
    indexed: True
    fieldId: wY6_jhf7SFOmmdMt4Ql9eA==
$ gam print users query "UserInfo.Role='Test'"
Getting all Users that match query (UserInfo.Role='Test'), may take some time on a large G Suite Account...
primaryEmail

Ross

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.

Raul Molina

unread,
Sep 17, 2018, 7:14:33 AM9/17/18
to GAM for G Suite
Hello Ross

Finally worked! I run gam print users query "pwdLastSet.pwdLastSet<=2018-10-10"

Thanks a lot
Raul,

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


-- 

-- 
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.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
Reply all
Reply to author
Forward
0 new messages