Wipe User Profiles on Chromebooks Recently Used by a Specific User

186 views
Skip to first unread message

Shaun Creighton

unread,
Nov 1, 2021, 7:57:44 PM11/1/21
to GAM for Google Workspace
We've experienced a few cases lately where students are having their Google passwords reset and then are unable to log in to a Chromebook because it asks for their old password. Using GAMADV-XTD3 I was able to use this command to pull all of the Chromebooks that the student recently used:

gam config csv_output_row_filter "'recentUsers.email:regex:USERNAMEHERE'" print cros todrive recentusers fields deviceid,assetid,org,recentusers

I was then able to use "gam cros issuecommand wipe_users" to wipe the profiles from that small set of Chromebooks, which worked fine. But now I'm getting greedy and am wondering if there's some way to pipe the output from the "print cros" command directly into the "gam cros issuecommand" part. I know "gam cros croscsvfile" can read from a Google Sheet, but I was hoping to just do it piped. Would something like this work?

gam config csv_output_row_filter "'recentUsers.email:regex:USERNAMEHERE'" redirect csv - multiprocess print cros recentusers fields deviceid,assetid,org,recentusers | gam csv - gam issuecommand cros ~deviceid command wipe_users doit

Or is there some way that croscsvfile itself could point to the piped input?

Ross Scroggs

unread,
Nov 1, 2021, 8:02:45 PM11/1/21
to google-ap...@googlegroups.com
Shaun,

You're very close; drop the multiprocess
gam config csv_output_row_filter "'recentUsers.email:regex:USERNAMEHERE'" redirect csv - print cros recentusers fields deviceid,assetid,org,recentusers | gam csv - gam issuecommand cros ~deviceid command wipe_users 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/44b46772-b67b-44d6-ab83-71f8906a83bdn%40googlegroups.com.


--

Ross Scroggs

unread,
Nov 1, 2021, 8:10:28 PM11/1/21
to google-ap...@googlegroups.com
Shaun,

It should be ~deviceId (capital I)
gam config csv_output_row_filter "'recentUsers.email:regex:USERNAMEHERE'" redirect csv - print cros recentusers fields deviceid,assetid,org,recentusers | gam csv - gam issuecommand cros ~deviceId command wipe_users doit

Ross
--
Reply all
Reply to author
Forward
0 new messages