Find blank asset ID

195 views
Skip to first unread message

Bryan Guidroz

unread,
Mar 4, 2021, 10:45:18 PM3/4/21
to GAM for Google Workspace
I can't quite figure out how to get GAM to help me find Chromebooks with a blank asset ID.  This works great if I enter the asset ID.

gam print cros query "asset_id:ABC123" fields deviceId ou serialNumber model notes assetID osversion status

But, I want a list of devices with a blank asset ID.  Any suggestions?

Kristine McNamara

unread,
Mar 4, 2021, 11:00:48 PM3/4/21
to GAM for Google Workspace
Sometimes Excel is your friend.   I would eliminate the query and import the csv into your favorite desktop spreadsheet app and then sort by the asset id column.    

Ross Scroggs

unread,
Mar 4, 2021, 11:02:06 PM3/4/21
to google-ap...@googlegroups.com
Bryan,

Tne API doesn't support such a request but both Basic and Advanced GAM can help.
Basic GAM
export GAM_CSV_ROW_FILTER="annotatedAssetId:regex:^$"

gam print cros fields deviceId,ou,serialNumber,model,notes,assetID,osversion,status

Advanced GAM

gam config csv_output_row_filter "annotatedAssetId:regex:^$" print print cros fields deviceId,ou,serialNumber,model,notes,assetID,osversion,status

The regex expression ^$ matches the beginning of the line and the end of the line woth nothing in between

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/da1039a8-6fc8-4195-9698-e8a0d1a73834n%40googlegroups.com.

Bryan Guidroz

unread,
Mar 4, 2021, 11:10:01 PM3/4/21
to GAM for Google Workspace
I'm working on a windows machine... maybe a silly question... the export on Windows?

Bryan Guidroz

unread,
Mar 4, 2021, 11:12:21 PM3/4/21
to GAM for Google Workspace
I've done that but was looking for a quicker way.

Joseph Sanders

unread,
Mar 4, 2021, 11:18:30 PM3/4/21
to google-ap...@googlegroups.com
Ross, 

When I run that, I get an error message:

ERROR: Invalid choice (print): Expected  (admin:adminrole.......bunch of stuff....




Ross Scroggs

unread,
Mar 4, 2021, 11:23:11 PM3/4/21
to google-ap...@googlegroups.com
Bryan/Joseph/Ohers,

Extra print in command:
Advanced GAM

gam config csv_output_row_filter "annotatedAssetId:regex:^$" print cros fields deviceId,ou,serialNumber,model,notes,assetID,osversion,status

Ross

Joseph Sanders

unread,
Mar 4, 2021, 11:26:09 PM3/4/21
to google-ap...@googlegroups.com
Ah! I didn't catch that, thanks!

Bryan, at the end of the command add the following (change the csv name to whatever you want)

> devicesNoAssetID.csv

So....

gam config csv_output_row_filter "annotatedAssetId:regex:^$" print cros fields deviceId,ou,serialNumber,model,notes,assetID,osversion,status > devicesNoAssetID.csv




Bryan Guidroz

unread,
Mar 4, 2021, 11:40:12 PM3/4/21
to GAM for Google Workspace
Thanks

Reply all
Reply to author
Forward
0 new messages