Delete "Pending approval" devices

190 views
Skip to first unread message

IndianaNetworkAdmin

unread,
Jun 1, 2022, 9:56:00 AM6/1/22
to GAM for Google Workspace
I attempted to delete ~9,330 unapproved devices from the device list using a CSV export from the admin panel "Devices > Mobile & Endpoints > Devices" page in the admin panel, with the status filter of "Pending approval" applied. I renamed the "Device ID" column deviceid.

gam csv ".\devices.csv" gam delete device ~deviceid doit

I receive the following errors on every single device:

ERROR: Parameter "name" value "devices/<randomstring>" does not match the pattern "^devices/[^/]+$"
API calls retry data
Quota exceeded for quota metric 'All DevicesService API write requests' and limit 'All DevicesService API write requests per minute' of service 'cloudidentity.googleapis.com' for consumer 'project_number:<projectID>'.: 42/0:08:04
Device:
devices/<randomstring>, Delete Failed: Request contains an invalid argument.

When I attempt to delete a single device, I receive:
Device: devices/<id>, Delete Failed: Request contains an invalid argument.

Using the command:
gam delete device <deviceid> doit

Ross Scroggs

unread,
Jun 1, 2022, 1:40:12 PM6/1/22
to google-ap...@googlegroups.com
Micheal,

The export Decive ID is not hte deviceId that the API wants, if fact they don't export what the API wants at all.

Here's what the API Wants
devices/EiQ0YWVlMzQyOC02OGZiLTRlOWMtOGM5ZC0zYzQ2OWJmZTUzMDg%3D not 4aee3428-68fb-4e9c-8c9d-3c469bfe5308

so you have to use a query.

Try:

gam csv ".\devices.csv" gam delete device query "id:~~deviceid~~" doit

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/68557333-c165-4e4b-8eb8-3f402aa0bc65n%40googlegroups.com.

Michael Purdue

unread,
Jun 1, 2022, 1:58:32 PM6/1/22
to google-ap...@googlegroups.com
Awesome, that resolved it for me, it's working fine now.

Thanks!

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/Zvsprq_fQxw/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/EAEA5B66-1D1C-4B21-935A-BDF3CE3167B2%40gmail.com.
Reply all
Reply to author
Forward
0 new messages