RE: Is it possible to insert Asset ID using GAM for each device?

1,489 views
Skip to first unread message

Ajmal Rasouli

unread,
Oct 13, 2021, 10:52:52 AM10/13/21
to GAM for Google Workspace
Hi,

Is it possible to insert mass Asset ID using GAM?
I have 300 Chromebook, they are added into an OU in the G suite. I would like to assign each chromebook device with a code from 001 to 301. Without GAM I will click on each device and assign the Asset ID but will take time. Is it possible to insert mass Asset ID using GAM?

Kind regards,
Ajmal

Jason Komendat

unread,
Oct 13, 2021, 4:19:00 PM10/13/21
to GAM for Google Workspace
Yea this is what I used

gam csv devices.csv gam update cros query:id:~theserialnumber assetid ~districttag

The CSV looks like this:

theserialnumber,districttag
121321,test1 121322,test2

Ajmal Rasouli

unread,
Oct 14, 2021, 8:59:42 AM10/14/21
to GAM for Google Workspace
Thanks Jason,

Since I am a new GAM user just wanted to double check something with you. I have something similar to the following:
my OUs:
mydomain.org > abc.com > students > 5A >
this is my my list: How should I make the csv file? Also, how can I tell GAM to only update devices in the 5A ou?

Serial number Asset ID Location
GFTDF45 001 5A
GHFFGF5 002 5A
HGFGFG7 003 5A
HJHGUH8 004 5A
MJHGFDF 005 5A
GHDSWF4 006 5A
HGFDR45 007 5A


I have moved the 300 devices to 5A OU. 
Thanks for the help.


Kind regards,
Ajmal

James SEYMOUR

unread,
Oct 15, 2021, 4:41:27 AM10/15/21
to GAM for Google Workspace
Hi Ajmal,

If you are updating the Chromebooks using a CSV then the location is not needed in the CSV. The CSV just needs the serial number and the new Asset ID. The command will find the Chromebook with a specific Serial Number and then update the corresponding Asset ID. I tend to make my headings without spaces so it is easier to write and run the GAM commands. Headings are case-sensitive. I you need help with making the CSV then I think you need to check Google for that :)

So your devices.csv will look like;-

Serialnumber,AssetID
GFTDF45,001
GHFFGF5,002
HGFGFG7,003
HJHGUH8,004
MJHGFDF,005
GHDSWF4,006
HGFDR45,007

The Command will be;-
gam csv devices.csv gam update cros query:id:~Serialnumber assetid ~AssetID

Cheers

James

Ross Scroggs

unread,
Oct 15, 2021, 9:04:20 AM10/15/21
to google-ap...@googlegroups.com
Ajmal,

Jame's command needs a slight modification.
gam csv devices.csv gam update cros query:id:~~Serialnumber~~ assetid ~AssetID

Ross
Jerudong International School
https://www.jerudonginternationalschool.com
Follow us on:
http://www.facebook.com/jisbruneidarussalam http://www.twitter.com/jisbrunei http://www.instagram.com/jisbrunei https://www.youtube.com/user/JISBrunei https://www.flickr.com/photos/133960569@N03/albums

--
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/18bf80db-72cc-4151-a84a-149763ecc52cn%40googlegroups.com.

Ajmal Rasouli

unread,
Oct 18, 2021, 8:09:16 AM10/18/21
to GAM for Google Workspace
Thanks James and Ross for your help.
Great community. 

Kind regards,
Ajmal

sami dean

unread,
Feb 27, 2023, 2:33:04 PM2/27/23
to GAM for Google Workspace
Hi All,

Note sure if this is still an active thread. Command is not working for me, getting below error:

C:\GAM>
C:\GAM>gam csv TestAssetID.csv gam update cros query:id:~~Serialnumber~~ assetid ~AssetID

ERROR: Header "Serialnumber" not found in CSV headers of "Serialnumber,AssetID".

C:\GAM>

my csv file looks like this:

Serialnumber,AssetID
123456,asdasd
9874984,asdkbuasd

James SEYMOUR

unread,
Feb 27, 2023, 6:29:31 PM2/27/23
to GAM for Google Workspace
Hi Sami,

Your command and CSV you have posted looks OK and works for me. I recreated the CSV and got this. Not sure what may be causing this, but looks like it is in the CSV, so have you tried to recreate it?

gam csv TestAssetID.csv gam update cros query:id:~~Serialnumber~~ assetid ~AssetID 2023-02-28T07:22:53.852+08:00,0/2,Using 2 processes...
Getting all CrOS Devices that match query (id:9874984), may take some time on a large Google Workspace Account...
Getting all CrOS Devices that match query (id:123456), may take some time on a large Google Workspace Account...
Got 0 CrOS Devices...
Got 0 CrOS Devices that matched query (id:9874984)
Got 0 CrOS Devices...
Got 0 CrOS Devices that matched query (id:123456)

AST Tech (Linda)

unread,
Aug 10, 2023, 8:58:48 PM8/10/23
to GAM for Google Workspace
This is what I use to update asset id.

gam update cros cros_sn <SERIAL> assetid <ID> 

I use GAM in Google Cloud Shell and use Google Sheets as CSV, so an example of the command I use is:

gam csv gsheet <EMAIL> <SHEET URL> <SHEET NAME> gam update cros cros_sn ~sn assetid ~id

Reply all
Reply to author
Forward
0 new messages