Device Deprovision

50 views
Skip to first unread message

Tom Kinane

unread,
Jan 21, 2022, 12:02:26 PM1/21/22
to GAM for Google Workspace
I have a spreadsheet of mixed AssetIds and Serial Numbers of Chromebooks I would like to Deprovision.

I have the command to Deprovision with the serial number from a csv.
gam csv e:\gamwork\serial.csv gam update cros cros_sn ~serial action deprovision_retiring_device acknowledge_device_touch_requirement

I am trying to write the command to pull AssetId from a csv and do a cros_query to get the serial numbers for those devices written to another csv so I can then use it to deprovision.  This is what I have but it errors out on "query"

gam crosfile e:\gamwork\assetid.csv print cros query print query "asset_id:~assetid" todrive basic

Is there anyway to make this work?  
Thanks.

Ross Scroggs

unread,
Jan 21, 2022, 2:19:25 PM1/21/22
to google-ap...@googlegroups.com
Tom,

You need ~~ surrounding a CSV file field name when it's embedded in an argument.

gam crosfile e:\gamwork\assetid.csv print cros query print query "asset_id:~~assetid~~" todrive basic

Ross


This message and any attachment thereto is for the sole use of the intended recipient(s), and is covered by the Electronic Communications Privacy Act (18 USC 2510 et seq.). It may contain information that is confidential and legally privileged within the meaning of applicable law. If you are not the intended recipient, please immediately alert the sender by reply e-mail, permanently remove this message and any attachments thereto from your system, and destroy any hard copies thereof; do not disclose the contents or take any action in reliance upon the information contained in this message or any attachments. If you have any doubt as to the authenticity of this message or any attachment thereto, please contact the sender immediately. Any copying, disclosure, distribution or other action taken or omitted to be taken with respect to an erroneously received or inauthentic message or attachment is prohibited.

--
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/91fefd61-9701-419c-8835-edc0f64267bcn%40googlegroups.com.


--

Tom Kinane

unread,
Jan 21, 2022, 2:26:16 PM1/21/22
to GAM for Google Workspace
Thank, Ross.  I just tried that and I get this:
Command: gam crosfile e:\gamwork\assetid.csv print cros query print >>>query<<< asset_id:~~assetid~~ todrive basic

ERROR: Invalid argument

Ross Scroggs

unread,
Jan 21, 2022, 2:39:51 PM1/21/22
to google-ap...@googlegroups.com
Tom,

Sorry, an extra query print got in there.

gam crosfile e:\gamwork\assetid.csv print cros query "asset_id:~~assetid~~" todrive basic

Ross



--

Tom Kinane

unread,
Jan 21, 2022, 2:54:26 PM1/21/22
to GAM for Google Workspace
Ok!  Thanks.  Getting somewhere.
Now the result is: (I understand the first line bc that is the field name)
CrOS Device: assetid, Print Failed: Does not exist (1/10)
CrOS Device: T1-19000301, Print Failed: Does not exist (2/10)
CrOS Device: T1-19000048, Print Failed: Does not exist (3/10)

Not sure why it is saying does not exist.  I run the command:
gam cros_query "asset_id:T1-19000301" info
and it finds it and I can get the info.  I see the only difference is the underscore in "cros_query" vs "cros query"

Ross Scroggs

unread,
Jan 21, 2022, 2:56:47 PM1/21/22
to google-ap...@googlegroups.com
Tom,

Contact me via Meet/Zoom.

Ross



--

Ross Scroggs

unread,
Jan 21, 2022, 3:08:02 PM1/21/22
to google-ap...@googlegroups.com
Tom,

Maybe I should use both halves of my brain. Here is the correct Advanced GAM solution.

gam redirect csv - multiprocess todrive csv e:\gamwork\assetid.csv gam print cros query "asset_id:~~assetid~~" basic

Ross



--

Tom Kinane

unread,
Jan 21, 2022, 3:12:42 PM1/21/22
to GAM for Google Workspace
Excellent!  Thanks Ross!  
Using both sides of my brain usually helps me to.

This should get me to a file that I can then use on the deprovision and pull the field column to deprovision.
Reply all
Reply to author
Forward
0 new messages