GWS-007 · Script
Endpoint Inventory
Exports Chromebooks, mobile devices, and endpoint-managed computers to dated CSV files.
Version 1.0.0Language PowerShellUpdated November 2026Report only, changes nothing
What it does
Read-only. Creates up to three CSV files in the Reports folder:
- Chromebooks: serial, model, OU, status, OS version, last sync, update-through date, labels
- Mobile devices: owner, model, OS, status, last sync, compromised and encryption status
- Endpoint-managed devices: serial, type, owner type, OS, last sync, management state
Also counts devices that have not synced in -StaleDays days.
Requirements
GAM7, installed and authorized by you. GAM is not included. Windows PowerShell 5.1 or PowerShell 7.
How to run it
- Run from: an admin workstation or scheduled task with GAM7 set up
- This is an admin script for your Google Workspace tenant, not a per-device endpoint script
- User interaction: none with app-only sign-in
- Schedule: run on demand, or weekly for reports
Settings
| Name | What it does | Options | Default |
|---|---|---|---|
| StaleDays | Days without a sync before a device counts as stale. Default: 30. | 30 | |
| AlertOnStale | Exit 1 when any stale devices are found (useful for scheduled checks). | False | |
| SkipMobile | Skip the mobile device export. | False | |
| SkipEndpoints | Skip the endpoint-managed device export. | False | |
| GamPath | Path to GAM. Default: gam (on PATH). | gam |
Exit codes
- 0 = Completed
- 1 = Completed and stale devices found (only with -AlertOnStale), or an export failed
- 2 = Script error (see log)
Testing steps
- Run it on one test tenant or small OU and check the output and log.
- Check the exit code: 0 = OK, 1 = needs attention, 2 = error (see log), 9 = this copy is past its Valid until date.
- Roll out to a small group next, then everyone.
Rollback steps
Report only. It saves CSV files and changes nothing else.
Version and change log
| Version | Date | Changes |
|---|---|---|
| 1.0.0 | November 2026 | First release. |