Disable chromebooks from sync query

38 views
Skip to first unread message

Darrell Johnson

unread,
Feb 13, 2025, 10:13:33 AM2/13/25
to GAM for Google Workspace
I am at a loss. I am trying to find chromebooks that have not had a sync in -40w and then disable them.
I will eventually also query last sync -2y and deprovision.

I can run the query 
print cros query "sync:..#querytime1# status:provisioned" querytime1 -40w 
and return CBs, i just an not able to figure out how to run the action against them

this is what i have, but I am sure it looks silly
gam print cros query "sync:..#querytime1# status:provisioned" querytime1 -40w | gam update action disable




Secondly I tried to run the query for a date range
print cros query "sync:#querytime1#..#querytime2# status:provisioned" querytime1 -2y querytime2 -40W 
but the second refrence seems to break the first one as this is the output

Getting all CrOS Devices that match query (sync:#querytime1#..2024-05-09T00:00:00 status:provisioned) for /, may take some time on a large Organizational Unit...


thank you for any help


Ross Scroggs

unread,
Feb 13, 2025, 10:23:15 AM2/13/25
to google-ap...@googlegroups.com
gam print cros query "sync:..#querytime1# status:provisioned" querytime1 -40w | gam csv - gam update cros "~deviceId" action disable

There is a bug here, I'll fix

print cros query "sync:#querytime1#..#querytime2# status:provisioned" querytime1 -2y querytime2 -40W 

Ross
----
Ross Scroggs



--
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 visit https://groups.google.com/d/msgid/google-apps-manager/415c814f-568d-40b7-80a3-f9341500d03an%40googlegroups.com.

Ross Scroggs

unread,
Feb 13, 2025, 10:23:18 AM2/13/25
to google-ap...@googlegroups.com
gam print cros query "sync:..#querytime1# status:provisioned" querytime1 -40w | gam csv - gam update cros "~deviceId" action disable

There is a bug here, I'll fix

print cros query "sync:#querytime1#..#querytime2# status:provisioned" querytime1 -2y querytime2 -40W 

Ross
----
Ross Scroggs


On Feb 13, 2025, at 7:11 AM, Darrell Johnson <djsa...@gmail.com> wrote:

Ross Scroggs

unread,
Feb 13, 2025, 11:15:26 AM2/13/25
to google-ap...@googlegroups.com
Version 7.04.01 fixes the bug.

$ gam print cros query "sync:#querytime1#..#querytime2# status:provisioned" querytime1 -2y querytime2 -40W  

Getting all CrOS Devices that match query (sync:2023-02-14T00:00:00..2024-05-09T00:00:00 status:provisioned) for /, may take some time on a large Organizational Unit...


Ross

----
Ross Scroggs


Darrell Johnson

unread,
Feb 13, 2025, 2:24:27 PM2/13/25
to GAM for Google Workspace
Thank you so much. It is so amazing the response time and that you already did a patch. Wild!
Reply all
Reply to author
Forward
0 new messages