Chrome device fleet reporting using APIs

Chrome Devices have been a huge success in places like schools where students and teachers want the mobility and price point of a tablet but usability of a laptop. Like everything else Google focuses on scale and part of the Chrome Device offering to enterprises and schools are the tools around the devices to manage the fleet.
Chrome Device management can be centralized which allows admins not only manage apps on the device, they can also push complex network and system settings with a touch of a few key strokes. And that works the same way for a customer with 10 devices and one with 20000.

Recently Google released a new batch of APIs called the Admin SDK which includes some new APIs to discover and manage devices in the fleet. Using these APIs, admins can not only get a list of the active devices they have, they can also find out if the devices are having update issues. As an example of how to use this API, I’ve published a sample script called “ChromeOSDeviceStats” which I wrote for my own domain. This could be used to quickly get high level stats of devices in the domain, when they were enrolled, what version they are on, and what Orgs are they part off.

The script could be further adapted to automatically send email reports like these when certain conditions are met. For example, if a school is interested in knowing about all recent “enrollments”, they could enhance this script to send that report.

—————————————————————————
Total devices : 31
Total active : 31
Total in Dev mode : 1
Total devices enrolled in last 2 days : 0
Total devices enrolled in last 7 days : 1
Total devices enrolled in last 1 month : 2
Total devices enrolled in last 1 year : 6
Distribution of devices across models: 
                          Alex : 5 
                          Google_Stumpy : 2 
                          Google_Link : 6 
                          Google_Snow : 1 
                          Google_Lumpy : 8 
Distribution of devices across versions: 
                          24 : 1 
                          25 : 5 
                          26 : 2 
                          27 : 5 
                          21 : 6 
                          23 : 3 
Distribution of devices across orgUnits: 
                          /Eng : 3 
                          /hack : 1 
                          / : 31 
—————————————————————————