Need Help with Deprovision Command

589 views
Skip to first unread message

Sang Ly

unread,
May 12, 2022, 3:38:25 PM5/12/22
to GAM for Google Workspace
Hi,

I have a list of serial number that the my school would like to deprovision, wipe, and move to Deprovison ou

I have the list of serial number in csv.  Please advise
I like to use this command but do not if the syntax is correct

gam csv cros7.csv gam cros_sn ~SerialNumber issuecommand command remote_powerwash doit
gam csv cros7.csv gam cros_sn ~SerialNumber issuecommand command deprovision_retiring_device doit
gam csv cros7.cvs gam cros_sn ~SerialNumber update ou /DeprovisionedChromebooks

Jason Komendat

unread,
May 13, 2022, 1:15:30 PM5/13/22
to GAM for Google Workspace
This is what I used and it worked gam.exe csv C:\PATH\depro.csv gam update cros query:id:~~serial~~ action deprovision_same_model_replace acknowledge_device_touch_requirement

Sang Ly

unread,
Jul 7, 2022, 1:01:11 PM7/7/22
to GAM for Google Workspace
Hi

I try and it say ERROR: Header "serial" not found in CSV headers of "serialNumber".

Ross Scroggs

unread,
Jul 7, 2022, 1:05:40 PM7/7/22
to google-ap...@googlegroups.com
Change the command to reference the correct header:
gam.exe csv C:\PATH\depro.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 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/86c5f794-9bc5-4908-a76e-2b1cb298518en%40googlegroups.com.


--

Sang Ly

unread,
Jul 7, 2022, 1:26:53 PM7/7/22
to GAM for Google Workspace
Thanks for the reply but I am getting this error


ERROR: 412: Illegal device state transition. - conditionNotMet

Sang Ly

unread,
Jul 7, 2022, 2:54:27 PM7/7/22
to GAM for Google Workspace
Hi, It is working now.

Thanks so much

Evan Finkelstein

unread,
Jul 14, 2022, 10:09:24 AM7/14/22
to GAM for Google Workspace
Hi,

How do you do this using Advanced GAM with a Google Sheet?

Thanks,
Evan

Ross Scroggs

unread,
Jul 14, 2022, 10:12:55 AM7/14/22
to google-ap...@googlegroups.com
Evan,


gam.exe csv gsheet  us...@domain.com <DriveFileId> <SheetName> gam update cros query:id:~~serialNumber~~ action deprovision_same_model_replace acknowledge_device_touch_requirement

Ross

Evan Finkelstein

unread,
Jul 14, 2022, 10:30:14 AM7/14/22
to GAM for Google Workspace
Thanks. How do I make it also factory reset the device?

Ross Scroggs

unread,
Jul 14, 2022, 11:01:02 AM7/14/22
to google-ap...@googlegroups.com

Evan Finkelstein

unread,
Jul 14, 2022, 11:23:39 AM7/14/22
to google-ap...@googlegroups.com
In Google Admin Console, I can factory reset and deprovision at the same time, but it looks like you're saying I have to do this as two commands.
But if I powerwash first and then deprovision, then it won't get the deprovision command until it's connected to WiFi again, since powerwashing will remove the WiFi profiles.
And if I deprovision first, then I don't think the powerwash command will work, since it's then no longer under my management.

How can I get around that issue?

Thanks,

Evan Finkelstein
Director of Technology | Ben Porat Yosef
(201) 845-5007 Ext. 1820

For fastest response and tracking purposes, please email help...@benporatyosef.org with any technology requests.


You received this message because you are subscribed to a topic in the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/-oWZLxCOgwA/unsubscribe.
To unsubscribe from this group and all its topics, 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/CAJkvRS-abLaac%2Br-gZVVhG-VCs_YzVHschEV11E%3Dm6kLJy%3DRpg%40mail.gmail.com.

Ross Scroggs

unread,
Jul 14, 2022, 11:40:47 AM7/14/22
to google-ap...@googlegroups.com
Evan,


The API doesn't explicitly support this but try this and see if the device data is removed: action deprovision_retiring_device

Ross



--

Evan Finkelstein

unread,
Jul 14, 2022, 2:07:00 PM7/14/22
to GAM for Google Workspace
Thanks. I'm just going to move all of them to a dedicated OU and then retire/wipe from the Google Admin Console.
But my move isn't working; trying to it in bulk from a sheet where the column header for serial numbers is "serial".

gam csv gsheet  user...@domain.com [file-id] "Sheet1" gam move cros ou [ou-path] move query:id:~~serial~~

Thanks,
Evan

Ross Scroggs

unread,
Jul 14, 2022, 2:20:17 PM7/14/22
to google-ap...@googlegroups.com
Evan,

You want:
gam csv gsheet  user...@domain.com [file-id] "Sheet1" gam update cros cros_sn "~serial" ou [ou-path]

Ross




--

Sang Ly

unread,
Jul 15, 2022, 10:31:04 AM7/15/22
to GAM for Google Workspace
Thanks for the command.

On Friday, May 13, 2022 at 10:15:30 AM UTC-7 Jason Komendat wrote:

Blair Johnston

unread,
May 31, 2023, 8:37:28 PM5/31/23
to GAM for Google Workspace
Hey Ross. Is there an advanced GAM command to depro from a local CSV rather than a  GSheet?

Ross Scroggs

unread,
May 31, 2023, 10:10:35 PM5/31/23
to google-ap...@googlegroups.com
Blair,

gam csv localfile.csv gam ...

Ross
----
Ross Scroggs



Reply all
Reply to author
Forward
0 new messages