0

I am working with the Google Admin SDK Directory API in managing domain Chromebooks. I am reviewing the chromeosdevices.list method, in hopes of reducing the number of returned device resources by filtering for a specific OU either by OrgUnitPath or by OrgUnitId. The documentation hints that this may be possible through use of the query parameter:

query string Search string in the format given at View device information and organizational units.

Using the tool available with the documentation I am able to exercise query parameters such as status:deprovisioned but am unable to limit by OU placement.

Is it possible with the current Directory API to get a list of chromeosdevice resources for a specific OU? If so, how?

Reno Blair
  • 154
  • 5

2 Answers2

1

You can try using gShell with this command:

Get-GAChromeosdevice -All | where {$_.OrgUnitPath -like "*[organisation]"}

Thing is you will be checking all devices. Maby this will be an option in the next version of the Directory API

Tunaki
  • 132,869
  • 46
  • 340
  • 423
T. Willemse
  • 71
  • 1
  • 3
0

I have a function that does this. Look at "whereMyChromiesAt()" on the following site.

https://github.com/stephengale801/random-GAS-scripts/blob/e8f9617bf24e3a2ec2bf11f04960e1f1d9bf96f2/Sync-OU-to-Group/ImportUsers.gs

Sorry I couldn't type it out, in on my phone ATM.

Bigfella
  • 11
  • 4
  • Thank you for the script, but that's actually what I do now. We have a lot of devices, and just exporting all of them actually takes almost two minutes. I'm hoping I can shrink that down by only getting specific OUs in a call. – Reno Blair Nov 23 '15 at 15:09
  • I've seen one or two other scripts using the `query:{"orgUnitPath":"/path"}` but when I attempted to use it in my script - it didn't work as expected. – Bigfella Nov 23 '15 at 16:41