Chrome OS Device deprovision via CSV

4,026 views
Skip to first unread message

Kyle Tillman

unread,
May 16, 2017, 12:43:25 PM5/16/17
to GAM for G Suite
So I am trying to deprovision several hundred older Chrome OS devices using GAM. I am able to successfully do the individual Device ID method but I was wondering if it is possible to do in bulk by using a CSV. is their a way to modify the Device id part to look for a locally stored CSV? 

gam update cros {Device ID} action deprovision_same_model_replace acknowledge_device_touch_requirement

Jay Lee

unread,
May 16, 2017, 12:56:20 PM5/16/17
to google-ap...@googlegroups.com
Try:

gam csv myfile.csv gam update cros ~deviceId action deprovision_same_model_replace acknowledge_device_touch_requirement

where myfile.csv is your CSV file and deviceId is the column header in your CSV for the device IDs.

On Tue, May 16, 2017 at 12:43 PM, Kyle Tillman <ktil...@lps.k12.co.us> wrote:
So I am trying to deprovision several hundred older Chrome OS devices using GAM. I am able to successfully do the individual Device ID method but I was wondering if it is possible to do in bulk by using a CSV. is their a way to modify the Device id part to look for a locally stored CSV? 

gam update cros {Device ID} action deprovision_same_model_replace acknowledge_device_touch_requirement

--
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-apps-manager@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/51771c3f-4184-4732-9052-c997e9fd318f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Kyle Tillman

unread,
May 16, 2017, 1:12:23 PM5/16/17
to GAM for G Suite
Thank God for you! This will save my district hundreds of man hours that we would have spent deprovisioning machines. 


On Tuesday, May 16, 2017 at 10:56:20 AM UTC-6, Jay Lee wrote:
Try:

gam csv myfile.csv gam update cros ~deviceId action deprovision_same_model_replace acknowledge_device_touch_requirement

where myfile.csv is your CSV file and deviceId is the column header in your CSV for the device IDs.
On Tue, May 16, 2017 at 12:43 PM, Kyle Tillman <ktil...@lps.k12.co.us> wrote:
So I am trying to deprovision several hundred older Chrome OS devices using GAM. I am able to successfully do the individual Device ID method but I was wondering if it is possible to do in bulk by using a CSV. is their a way to modify the Device id part to look for a locally stored CSV? 

gam update cros {Device ID} action deprovision_same_model_replace acknowledge_device_touch_requirement

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

Jay Lee

unread,
May 16, 2017, 1:20:08 PM5/16/17
to google-ap...@googlegroups.com
Glad to help :-)

Out of curiosity, is it certain model devices that you want to deprovision or a range of devices across models?

Jay

On Tue, May 16, 2017 at 1:12 PM, Kyle Tillman <ktil...@lps.k12.co.us> wrote:
Thank God for you! This will save my district hundreds of man hours that we would have spent deprovisioning machines. 

On Tuesday, May 16, 2017 at 10:56:20 AM UTC-6, Jay Lee wrote:
Try:

gam csv myfile.csv gam update cros ~deviceId action deprovision_same_model_replace acknowledge_device_touch_requirement

where myfile.csv is your CSV file and deviceId is the column header in your CSV for the device IDs.
On Tue, May 16, 2017 at 12:43 PM, Kyle Tillman <ktil...@lps.k12.co.us> wrote:
So I am trying to deprovision several hundred older Chrome OS devices using GAM. I am able to successfully do the individual Device ID method but I was wondering if it is possible to do in bulk by using a CSV. is their a way to modify the Device id part to look for a locally stored CSV? 

gam update cros {Device ID} action deprovision_same_model_replace acknowledge_device_touch_requirement

--
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+unsubscribe...@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-apps-manager@googlegroups.com.

Kyle Tillman

unread,
May 16, 2017, 1:26:52 PM5/16/17
to GAM for G Suite
At this point they are all the same model. Acer 710. The next round will be a much more diverse batch. About 3 different models to retire then.


On Tuesday, May 16, 2017 at 11:20:08 AM UTC-6, Jay Lee wrote:
Glad to help :-)

Out of curiosity, is it certain model devices that you want to deprovision or a range of devices across models?

Jay
On Tue, May 16, 2017 at 1:12 PM, Kyle Tillman <ktil...@lps.k12.co.us> wrote:
Thank God for you! This will save my district hundreds of man hours that we would have spent deprovisioning machines. 

On Tuesday, May 16, 2017 at 10:56:20 AM UTC-6, Jay Lee wrote:
Try:

gam csv myfile.csv gam update cros ~deviceId action deprovision_same_model_replace acknowledge_device_touch_requirement

where myfile.csv is your CSV file and deviceId is the column header in your CSV for the device IDs.
On Tue, May 16, 2017 at 12:43 PM, Kyle Tillman <ktil...@lps.k12.co.us> wrote:
So I am trying to deprovision several hundred older Chrome OS devices using GAM. I am able to successfully do the individual Device ID method but I was wondering if it is possible to do in bulk by using a CSV. is their a way to modify the Device id part to look for a locally stored CSV? 

gam update cros {Device ID} action deprovision_same_model_replace acknowledge_device_touch_requirement

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

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

Sylvia Gagne

unread,
Jun 11, 2018, 4:06:59 PM6/11/18
to GAM for G Suite
I am new to GAM, this is just my second task.  I have been trying to deprovision, using a similar syntax as you posted with a change to deprovision without a replacement - I am using: gam csv decomtest.csv gam update cros ~deviceId action deprovision_retiring_device acknowledge_device_touch_requirement
When I run the command, it looks like it is going to work with "performing action deprovision for "sn"
Then I get Temporary error: backendError, Backing off...

I did re-install GAM, I have version 4.4

Steve Carrington

unread,
Jun 11, 2018, 7:56:48 PM6/11/18
to google-ap...@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-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.


--
Steve Carrington
Chief Information Officer
Murphysboro CUSD #186
McElvain School
593 Ava Road
Murphysboro, IL  62966
V - 618-684-3781 X 6103

F - 618-684-2465

"Wrong does not cease to be wrong just because the majority share in it." - Leo Tolstoy


THIS TRANSMISSION IS INTENDED AND RESTRICTED FOR USE BY THE ABOVE ADDRESSEE ONLY.  IT MAY CONTAIN CONFIDENTIAL AND/OR PRIVILEGED INFORMATION EXEMPT FROM DISCLOSURE  UNDER FEDERAL OR STATE LAW. IN THE EVENT SOME OTHER PERSON OR ENTITY RECEIVES THIS  TRANSMISSION, SAID RECIPIENT IS HEREBY NOTIFIED THAT ANY DISSEMINATION, DISTRIBUTION,  OR DUPLICATION OF THIS TRANSMISSION OR ITS CONTENTS IS PROHIBITED. IF YOU SHOULD RECEIVE  THIS TRANSMISSION IN ERROR, PLEASE CALL US IMMEDIATELY AT 618-684-3781, DELETE THE FILE FROM YOUR SYSTEM, AND DESTROY ANY HARD COPIES OF THIS TRANSMISSION. THANK YOU.

Murphysboro Community Unit School District #186
Murphysboro, Illinois

Ross Scroggs

unread,
Jun 11, 2018, 8:05:17 PM6/11/18
to google-ap...@googlegroups.com
Sylvia,

This is Google's way of telling you that it doesn't like your deviceId.
$ gam update cros 1234 action deprovision_retiring_device acknowledge_device_touch_requirement
 performing action deprovision for 1234 (1 of 1)
Temporary error: backendError, Backing off: 16 seconds, Retry: 4/10

How did dcomtest.csv get generated?

Ross

Sylvia Gagne

unread,
Jun 12, 2018, 8:30:44 AM6/12/18
to GAM for G Suite
Hi Ross, 
For this test, I scanned the SN from three chromebooks into a spreadsheet.  Then I removed the last character of each - as I have to when searching the console for a chromebook by SN.

I have deprovisioned most of them now as I found in the console I could deprovision 30 at a time.  But I would still like to figure this out so I can use this to verify they have all been deprovisioned.


On Tuesday, May 16, 2017 at 12:43:25 PM UTC-4, Kyle Tillman wrote:

Ross Scroggs

unread,
Jun 12, 2018, 9:48:59 AM6/12/18
to google-ap...@googlegroups.com
Sylvia,

A ChromeOS deviceID and serialNumber are not the same thing; here's an example:
deviceId,serialNumber
01b7e202-0e5c-4ec5-b19b-0ba884c10xxx,xF054468C
0478bb22-310f-4d80-9dd0-f0c5c6a55yyy,xCD7526TX2

The Google API wants a deviceId:
gam update cros 01b7e202-0e5c-4ec5-b19b-0ba884c10xxx action deprovision_same_model_replace acknowledge_device_touch_requirement
If you only have a serial number do this:
gam info cros query:id:xF054468C action deprovision_same_model_replace acknowledge_device_touch_requirement
(Yes, when searching for a CrOS device Google uses id to mean serial number.)

Test with a serial number to see if you have to drop the last character.

So, if you have a CSV file (CrosSerials.csv) of serial numbers with the column serialNumber, you can do this:
serialNumber
xF054468C
xCD7526TX2

gam csv CrosSerials.csv gam update cros query:id:~~serialNumber~~ action deprovision_same_model_replace acknowledge_device_touch_requirement

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.

Sylvia Gagne

unread,
Jun 12, 2018, 10:10:43 AM6/12/18
to GAM for G Suite
I had a feeling when you asked about the device ID that it might be where I was going wrong.  
I will give this a try later and report back. Thanks for the assistance!
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Sylvia Gagne

unread,
Jun 12, 2018, 10:42:25 AM6/12/18
to GAM for G Suite
That did the trick. Thanks Ross!

Damien Dimino

unread,
Dec 7, 2018, 3:33:41 PM12/7/18
to GAM for G Suite
Ross,

Your script has helped tremendously however I'm getting stuck at one point. I can deprovision when referencing a single serial number with 

gam update cros query:id:xxxxxx action deprovision_retiring_device acknowledge_device_touch_requirement

However when I run this command:

gam csv GAM-CBD.csv gam update cros query:id:~~serialNumber~~ action deprovision_retiring_device acknowledge_device_touch_requirement

I get this message:

ERROR: Header "serialNumber" not found in CSV headers of "deviceId".

My CSV is referencing the serial number of my Chromebook like this:

serialNumber
xxxxxx
yyyyyy
zzzzzz

Your help would be greatly appreciated.

On Tuesday, June 12, 2018 at 9:48:59 AM UTC-4, Ross Scroggs wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Ross Scroggs

unread,
Dec 7, 2018, 3:44:34 PM12/7/18
to google-ap...@googlegroups.com
Damien,

gam csv GAM-CBD.csv gam update cros query:id:~~serialNumber~~ action deprovision_retiring_device acknowledge_device_touch_requirement
I get this message:
ERROR: Header "serialNumber" not found in CSV headers of "deviceId".

Gam reads the headers of GAM-CBD.csv and only sees deviceId, not serialNumber as you expected. Are you referencing the correct file?
Do: more GAM-CBD.csv
What do the first couple of lines look like.
 
Ross

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@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-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.


--

Adam Czapiga

unread,
Apr 12, 2019, 10:21:52 AM4/12/19
to GAM for G Suite
Did you ever find a solution? I'm getting a similar error of  

H:\>gam csv h:\gamstuff\t7.csv gam update cros query:id:~~Serial~~ ou ~OU

ERROR: Header "Serial" not found in CSV headers of "Serial,OU,LOC,Assetid".

That I am totally lost with.

Ross Scroggs

unread,
Apr 12, 2019, 10:35:13 AM4/12/19
to google-ap...@googlegroups.com
Adam,

The file is Unicode, try: H:\>gam csv h:\gamstuff\t7.csv charset utf8 gam update cros query:id:~~Serial~~ ou ~OU

Ross

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@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-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.


--

Adam Czapiga

unread,
Apr 12, 2019, 10:46:16 AM4/12/19
to google-ap...@googlegroups.com
Thanks that did it.

You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/HGSt9ei4w4Q/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Deidre Bothma Hugo

unread,
Aug 1, 2019, 11:47:18 AM8/1/19
to GAM for G Suite
Hi there Ross and Jay Lee, 

Just checking - but with the new look within the Admin Console for Device management, will the same command which Jay Lee originally shared still work correctly to deprovision devices in bulk via csv? 

gam csv myfile.csv gam update cros ~deviceId action deprovision_same_model_replace acknowledge_device_touch_requirement

Thank you! 


On Friday, April 12, 2019 at 4:46:16 PM UTC+2, Adam Czapiga wrote:
Thanks that did it.

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@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.


--
Ross Scroggs

--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/HGSt9ei4w4Q/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

Ross Scroggs

unread,
Aug 1, 2019, 11:57:39 AM8/1/19
to google-ap...@googlegroups.com
Deidre,

The API is unchanged, thus the command should work as shown.

  • ·         D I S C L A I M E R
    The information transmitted is intended only for the person or organisation to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or organisation other than the intended recipient is prohibited. If you receive this in error, please contact the sender and delete the material from any computer.
    This email and its contents have been scanned for viruses, but the scanner may not be able to detect or repair all viruses and variants. Please be aware that there is a risk involved whenever downloading email attachments to your computer or sending email attachments to others. Kuwait English School and its software providers accept no liability for loss or damage incurred as a result of downloading email attachments.
    sending a reply e-mail and delete this message. Thank you for your cooperation.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/ae1d1903-17a7-49f0-8e0d-c77951f241a2%40googlegroups.com.

Deidre Bothma Hugo

unread,
Aug 1, 2019, 12:04:05 PM8/1/19
to GAM for G Suite
You are the best - thank you so much. 


On Thursday, August 1, 2019 at 5:57:39 PM UTC+2, Ross Scroggs wrote:
Deidre,

The API is unchanged, thus the command should work as shown.

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

EDWARD ARAGON

unread,
Nov 1, 2023, 3:01:03 PM11/1/23
to GAM for Google Workspace
Thank you Ross, Deprovisioning devices now based on your syntax that you have shared with us. 
Reply all
Reply to author
Forward
0 new messages