Skip to content

Google Sheets Script for Domain Admins to get Chromebook Device Info from Google Admin and yo update device info.

Notifications You must be signed in to change notification settings

myxxmikeyxx/Google-Chromebook-Admin-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logo
Google Admin Chromebook Device Management Script

❗ USE AT OWN RISK ❗

Table of contents

Installation

Clasp

  1. Install Node.js from here. The version must be at least 4.7.4.

  2. Follow google developers directions to install clasp from Node.js here.

  3. Verify you have Google Apps Script API enabled here.

  4. Download latest release here and extract it.

  5. Open terminal/cmd/power shell inside project folder. (In Visual Studio Code do Ctrl+Shift+`)

  6. Do the following commands:

    • Create package.json (Doesn't really matter what you make it, just is needed for clasp login step):
    npm init
    
    • Clasp login:
    clasp login
    
    • Create Google Sheet with script attached:
    clasp create cbManagement
    
  7. Select sheets for where you want the script to install to.

  8. Do the following commands:

    clasp push
    clasp open
    
    This will push it to google script, then open the script.
  9. Click the info in the upper left.

  10. Now click the sheet. This will take you to the sheet the script is attached to. From here rename it to whatever you want.

Copy

  1. Download latest release here and extract it.

  2. Open a new google sheets document and name it.

  3. In the tool bar click Tools > code Script Editor.

  4. In Apps Script rename the script at the top.

  5. Copy and paste all of code.js into the code file, replacing everything.

  6. In the Files location click the add and chose script.

  7. Name one "columnRelation" & another "rowsData".

  8. Copy the script into the respective ones.

Usage

This script is for getting active chrome devices. Sorting them, adding and changing fields, and moving OU's.

Resources

I would like to thank everyone below for the great scripts that I was able to use and tweak to make this project happen.

Script & Spreadsheet here. This script was what I used as a base to make mine. I had to change a lot of stuff and later just went in my own direction, but the main get devices and update devices parts are from his script with minor tweaks.

The orginal script can be found here. I ended up tweaking it a bit to make it so the users and not an array of recent users. I also made it only show "ACTIVE" devices. (Google admin keeps deprovisoned device info for a while after they have been deprovisioned, and the get devices would show all devices without this change).

I used his script for letter to column & column to letter. The post I found it on is here. This script was not changed, plus it was very useful.

Troubleshooting

PowerShell

If you are getting "Execution Policy" error in PowerShell try here for help.