====== GAM (Google Admin Command Line) Notes/Hints ======
===== Set Password =====
gam update user password
===== Create User =====
gam create user firstname lastname password changepassword off agreedtoterms off
===== Suspend User =====
gam update user suspended on
===== Create Alias =====
gam create alias user
===== Add Users to a Group =====
gam update group add member
===== Print OUs =====
gam print orgs
===== Move Chrome Device to OU =====
gam update cros ou ""
gam update cros 04b697c1-32ef-419c-8e93-87d30c9d9eff ou "/Students/Elementary School/1st Grade"
===== Export Chrome Device CSV =====
gam print cros full listlimit 1 > CSVFILE
===== Disable ChromeOS Device =====
gam update cros e23455de-837a-4389-abdc-92a82526d7ac action disable
===== Reenable ChromeOS Device =====
gam update cros action reenable
===== Delete a specific email from a users Inbox (Use GAM not GAM-ADV) =====
Message-ID:
gam user delete|trash|untrash messages|threads
query [doit] [maxto ]
gam user tschulz@g.sebeka.k12.mn.us delete messages query rfc822msgid:CANPNmCK3mxGzaFUOmV2KPz9K0VCAJg86dZyrChDEpRGPqbb5GQ@mail.gmail.com doit
gam all users delete messages query rfc822msgid:CANPNmCK3mxGzaFUOmV2KPz9K0VCAJg86dZyrChDEpRGPqbb5GQ@mail.gmail.com doit
{{ :chromebooks:gam-cheat-sheet-a3.pdf |GAM Cheat Sheet }} [[https://gamcheatsheet.com/|From gamcheatsheet.com ]]
===== Transfer Google Drive file ownership =====
gam user add drivefileacl user role owner
===== Print Group Members =====
gam print group-members group fields email,role,status
===== Delete file from Google Drive =====
gam user show filelist id name owners parents > filelist.csv
==== filelist.csv====
* Use Column E for parent name
* //E=VLOOKUP(F,B$2:C$,2,0)//
gam user delete drivefile purge