GAM Syntax Help

74 views
Skip to first unread message

Aleksandr Kay

unread,
Jul 19, 2023, 4:41:20 PM7/19/23
to GAM for Google Workspace
Hey all, I am new to using GAM and I have hit a roadblock that I need some help with.

So, the problem that I have been having is that when I use "gam cros_query "asse_id:=2081 print fields deviceid,serialnumber,model" I get more devices than just the one I'm looking for.

I attached an image showing the result of the above query.

So, It grabbed 9 other Chrome devices because my query criteria matched, but was not an exact match. So, the question is what syntax do I use to only get a exact match
result?

I have tried using "::=" in the Backus-Naur form, but I just get "Got 0 Chrome Devices" message.

I appreciate any incite y'all can share with me about GAM and its syntax. Thanks.
CrosProblem.png

Ross Scroggs

unread,
Jul 19, 2023, 4:55:33 PM7/19/23
to google-ap...@googlegroups.com
The Directory API does prefix, not exact, matching with asset IDs and serial Numbers.. If you want an exact match, use the full asset ID.
In your case, as the exact asset ID is a prefix of the other asset IDs, you'll have GAM do the exact match filtering.
gam config csv_output_row_filter "annotatedAssetId:regex:^2081$" cros_query "asset_id:2081 print fields deviceid,serialnumber,model

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/fd8eec30-badc-4b9e-be87-ab14c9b7f075n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages