Moving Chromebooks to new OU

263 views
Skip to first unread message

Bob Morrison

unread,
Nov 14, 2022, 3:59:14 PM11/14/22
to GAM for Google Workspace
I am working on a project to put all our student Chromebooks into the correct OU.  
I have a .CSV that has serial number and new OU.  
As a test, this is the contents of the file "Move-Grade3-5CB.csv"
serial,ou
6V9PT33,/9-12

In this example, the Chromebook with serial number 6V9PT33 should be moved from the OU /3-5 to OU /9-12.

I am using this PowerShell script:
$list = Import-Csv "C:\Accounts\2022-2023\Move-Chromebooks\Move-Grade3-5CB.csv"
foreach ($entry in $list)
{
gam update cros query:id:$($entry.serial) ou $($entry.ou)
}

When I run this script, I get this error:
Got 1 CrOS Device...
Got 1 CrOS Device that matched query (id:6V9PT33)
Organizational Unit: /9-12, Add 1 CrOS Device
  Organizational Unit: /9-12, CrOS Device: e1d567a8-b2d8-4f64-8591-36daa1598694, Add Failed: 400: invalidInput - Invalid Input: Inconsistent Orgunit id and path in request - 5816620790317060, /9-12

What am I doing wrong?

Bob Morrison, CNE, MCSE, CCENT
Network Administrator
Wallingford CT Public Schools
rmor...@wallingfordschools.org 

Ross Scroggs

unread,
Nov 14, 2022, 4:16:09 PM11/14/22
to google-ap...@googlegroups.com
Bob,

What is: gam version

Ross

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/7db10289-8e3e-4040-9630-ba601a12cd2en%40googlegroups.com.


--

Bob Morrison

unread,
Nov 15, 2022, 8:30:18 AM11/15/22
to google-ap...@googlegroups.com
Ross

Here's the version information.

GAMADV-XTD3 6.18.04 - https://github.com/taers232c/GAMADV-XTD3 - pyinstaller
Python 3.10.4 64-bit final

Bob Morrison, CNE, MCSE, CCENT
Network Administrator
Wallingford CT Public Schools
rmor...@wallingfordschools.org 


Gabriel Clifton

unread,
Nov 15, 2022, 8:40:13 AM11/15/22
to GAM for Google Workspace
One thing I can think of is your OU. Is that OU at the root of your directory, or is it a sub-OU? I know mine are subs, so you have to specify the full path, like /Campus/9-12. If there is a space in an OU name, you have to enclose it in double quotes. "/High School/9-12".

Ross Scroggs

unread,
Nov 15, 2022, 9:23:03 AM11/15/22
to google-ap...@googlegroups.com
Bob,

Update, the current version is 6.28.09. This issue was fixed in 6.22.02

Ross
----
Ross Scroggs



Ross Scroggs

unread,
Nov 15, 2022, 9:23:57 AM11/15/22
to google-ap...@googlegroups.com
Bob,

Do:
gam update project
gam oauth create
gam user us...@domain.com check serviceaccount

Ross
----
Ross Scroggs


On Nov 15, 2022, at 5:29 AM, Bob Morrison <rmor...@wallingfordschools.org> wrote:

Bob Morrison

unread,
Nov 15, 2022, 9:50:24 AM11/15/22
to google-ap...@googlegroups.com
Ross

When I run these commands, I get this prompt:

Select the authorized scopes by entering a number.
Append an 'r' to grant read-only access or an 'a' to grant action-only access.

[*]  0)  Calendar API (supports readonly)
[*]  1)  Chrome Browser Cloud Management API (supports readonly)
[*]  2)  Chrome Management API - Telemetry read only
[*]  3)  Chrome Management API - read only
[*]  4)  Chrome Policy API (supports readonly)
[*]  5)  Chrome Printer Management API (supports readonly)
[*]  6)  Chrome Version History API
[*]  7)  Classroom API - Course Announcements (supports readonly)
[*]  8)  Classroom API - Course Topics (supports readonly)
[*]  9)  Classroom API - Course Work/Materials (supports readonly)
[*] 10)  Classroom API - Course Work/Submissions (supports readonly)
[*] 11)  Classroom API - Courses (supports readonly)
[*] 12)  Classroom API - Profile Emails
[*] 13)  Classroom API - Profile Photos
[*] 14)  Classroom API - Rosters (supports readonly)
[*] 15)  Classroom API - Student Guardians (supports readonly)
[*] 16)  Cloud Channel API (supports readonly)
[*] 17)  Cloud Identity Groups API (supports readonly)
[*] 18)  Cloud Storage (Vault Export - read only)
[*] 19)  Contact Delegation API (supports readonly)
[*] 20)  Contacts API - Domain Shared and Users and GAL
[*] 21)  Data Transfer API (supports readonly)
[*] 22)  Directory API - Chrome OS Devices (supports readonly)
[*] 23)  Directory API - Customers (supports readonly)
[*] 24)  Directory API - Domains (supports readonly)
[*] 25)  Directory API - Groups (supports readonly)
[*] 26)  Directory API - Mobile Devices Directory (supports readonly and action)
[*] 27)  Directory API - Organizational Units (supports readonly)
[*] 28)  Directory API - Resource Calendars (supports readonly)
[*] 29)  Directory API - Roles (supports readonly)
[*] 30)  Directory API - User Schemas (supports readonly)
[*] 31)  Directory API - User Security
[*] 32)  Directory API - Users (supports readonly)
[*] 33)  Email Audit API
[*] 34)  Groups Migration API
[*] 35)  Groups Settings API
[*] 36)  License Manager API
[*] 37)  People API (supports readonly)
[*] 38)  People Directory API - read only
[*] 39)  Pub / Sub API
[*] 40)  Reports API - Audit Reports
[*] 41)  Reports API - Usage Reports
[*] 42)  Reseller API
[*] 43)  Site Verification API
[*] 44)  Sites API
[*] 45)  Vault API (supports readonly)

     s)  Select all scopes
     u)  Unselect all scopes
     e)  Exit without changes
     c)  Continue to authorization

Do I have to make any changes or can I go right to "c)  Continue to authorization"?


Bob Morrison, CNE, MCSE, CCENT
Network Administrator
Wallingford CT Public Schools
rmor...@wallingfordschools.org 

(203) 294-5954


Gabriel Clifton

unread,
Nov 15, 2022, 9:53:40 AM11/15/22
to google-ap...@googlegroups.com
Continue



--

Gabriel Clifton | Network Administrator

Fort Stockton ISD | Technology Center

gabriel...@fsisd.net | http://www.fsisd.net

Office (432) 336-4055 Ext 2

Fax (432) 336-4050

1204 W. Second St., Fort Stockton, TX 79735


Please note: Although we sometimes respond to email, text, and phone calls instantly at all hours, our regular support hours are 8:00 AM - 5:00 PM, Monday through Friday.

We may need to wait until the next school day to address your issue. All issues are taken care of on a first-come, first-served basis, depending on severity, and problems with proper work orders submitted are handled first.


Confidentiality notice: The contents of this email message and any attachments are intended solely for the addressee(s), may contain confidential and/or privileged information and may be legally protected from disclosure. If you are not the intended recipient of this message or their agent, or if this message has been addressed to you in error, please immediately alert the sender by reply email and delete this message and any attachments. If you are not the intended recipient, you are hereby notified that any use, dissemination, copying, or storage of this message or its attachments is strictly prohibited.

Rance Hall

unread,
Nov 15, 2022, 10:45:56 AM11/15/22
to google-ap...@googlegroups.com

The reseller API is only available to you if you are an actual reseller, so you may not need this.

 

I disable Pub/Sub and Reseller at this step because as an Education customer I can’t use these.

 

I really try to enable all the service APIs I can as I never really know what someone will ask so I don’t want to reconfigure GAM each time I run it.

 

Your milage may vary.

 

R

 

From: google-ap...@googlegroups.com <google-ap...@googlegroups.com> on behalf of Bob Morrison <rmor...@wallingfordschools.org>
Date: Tuesday, November 15, 2022 at 8:50 AM
To: google-ap...@googlegroups.com <google-ap...@googlegroups.com>
Subject: Re: [EXTERNAL] Re: [EXTERNAL] [GAM] Moving Chromebooks to new OU

[EXTERNAL EMAIL]

Reply all
Reply to author
Forward
0 new messages