GAM cheat sheet for techs

1,891 views
Skip to first unread message

Gabriel Clifton

unread,
Jan 7, 2022, 6:41:03 PM1/7/22
to GAM for Google Workspace
I was thinking about creating a small cheat sheet for our techs with some basic commands that they can use. They don't have access to much and these would be small on-the-fly commands they can do so the list would be simple. I was wanting some input as to what else I could throw in for them.
Things they can do: simple user and Chromebook commands like enable/disable and change password. They may do a little more if it is simple copy/paste with little modification without looking things up like OUs.
What I have (GAMADV):

Enable user gam update user <email address> suspended off

Change user password, Google only gam update user <email address> password <new password>

Change user password to a random 8 character password and email X new password, Google only gam update user <email address> password uniquerandom 8 notify <email address 2>

Powerwash Chromebook gam issuecommand cros query:id:<serial number> command remote_powerwash times_to_check_status 10 doit

Remove all users on Chromebook gam issuecommand cros query:id:<serial number> command wipe_users doit

Disable Chromebook gam issuecommand cros query:id:<serial number> command disable doit

Enable Chromebook gam issuecommand cros query:id:<serial number> command reenable doit

Get information about the last Chromebook a user recently logged into gam config csv_output_row_filter "recentUsers.email:regex:<email address>" print cros serialnumber lastknownnetwork recentusers activetimeranges listlimit 1

Get information about all Chromebooks a user has logged into gam config csv_output_row_filter "recentUsers.email:regex:<email address>" print cros serialnumber lastknownnetwork recentusers activetimeranges


And, Happy International Programmers Day!


Kim Nilsson

unread,
Jan 8, 2022, 9:35:39 AM1/8/22
to GAM for Google Workspace
Good suggestion of commands.

Other examples of things you may want them to be able to do, so you don't have to, or don't have onboarding/ofboarding scripts that do.

Hide user in Directory
gam update user <email address> gal off

View info about user (quite useful, only way to see Google's unique userId) gam info user <email address>  

Add, Remove, Show Gmail delegates
gam user  <address to delegate>  add delegates <email address getting access>
gam user  <address to update>  delete delegates <email address losing access>
gam user  <delegated address>  show delegates

Print Classrooms by teacher todrive
gam print courses todrive teacher <email address>

Switch Classroom owner on courseid to teacher (courseIds seen in previous command)
gam update course <course id> owner <email address>  

But printing all Chromebooks to find those used by a single user is fairly-to-very slow.
A simple web app could be better for that if you have many Chromebooks. I created one that reads from a regularly gam-updated Google Sheet.

That way it doesn't have to print all devices before trying to find the ones matching the provided email, and then do a full print again when trying to find a second user. With many tens of thousands of devices it will take many minutes for each search. Instead my web app reads from a Google Sheet that is updated every night, or every ten minutes, depending on how often you wish it to be, and how many devices you have. The previous run just needs to finish before you schedule another run.

I call it CB_LookUp. Completely free and open source.

If you combine it with CB_QueryDetails or CB_DeviceDetails (DD is only in Swedish so far!) you can both view and see details about devices easily.

Gabriel Clifton

unread,
Jan 10, 2022, 9:48:22 AM1/10/22
to GAM for Google Workspace
Thanks, Mr. Nilsson, I knew you would give me a  few good ones. I do have a Chromebook inventory sheet that updates itself daily but threw that command in there for them for single instance use if they wanted to do it.

I like the CB_Lookup, but can't make it work.

Gabriel Clifton

unread,
Jan 10, 2022, 6:15:40 PM1/10/22
to GAM for Google Workspace
Thanks again for the help on the CB_Lookup Kim, it works wonderfully. Even after transferring everything to my GAM account.

Benjamin Wexler

unread,
Jul 16, 2022, 3:40:30 PM7/16/22
to GAM for Google Workspace
@Kim -- thank you for these helpful tools.

On Cb-Activity -- The "query" command in cell A2 on all sheets after Devices may be wrong. OS Version column on Sheet "Devices" is G, but I do not see that column in the query on the following sheets. This causes all column data to be incorrect on the following sheets.

TY

BW

Kim Nilsson

unread,
Jul 16, 2022, 4:15:10 PM7/16/22
to Google Apps Manager
Oh, I'll have to look into that.
Thank you. I'll do that tomorrow. 

Every now and then I improve the layout, and some times I forget to adjust all the formulas.

/Kim 

Kim Nilsson

unread,
Jul 17, 2022, 5:18:44 AM7/17/22
to Google Apps Manager
Thanks.
Errors fixed.

However, since you are a GAM user, then you might be interested in the GAM-optimised template?


It has, on purpose, less data, to make it faster for CB_LookUp.
If you want all the data, you can still grab them manually with CB_Inventory. Or just use gam with todrive. :-)

/Kim
--
There is No Substitute!

Benjamin Wexler

unread,
Jul 17, 2022, 5:33:48 AM7/17/22
to google-ap...@googlegroups.com
So it's funny you should mention cb_inventory. I/we primarily use cb_inventory currently.My IT team just recently, successfully, used it to digitally re-organize all our chromebook carts with a new naming convention. 

I only came up on this other sheet/app script by accident as I was looking for a gam commamd to see if there was a way to see who and when a user was created as the data wasn't showing in google admin. 


--
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/StmRxxnEIDA/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/CAGPzzFvm7PovdaRGQC9bd6Zzm%2BZnPf3jRjAy9hp9wskn7dMtnQ%40mail.gmail.com.

Kim Nilsson

unread,
Jul 17, 2022, 3:19:20 PM7/17/22
to Google Apps Manager
Aw, that makes me so happy to hear.
I'm glad it is of use to others. 

/Kim 

Patrick Haley

unread,
Jul 18, 2022, 8:44:41 AM7/18/22
to GAM for Google Workspace
In case you're looking for more inspiration, check out James Seymour's GAM commands: https://sites.google.com/jis.edu.bn/gam-commands/ 
Reply all
Reply to author
Forward
0 new messages