Moving Devices from root OU into Sub OUs

9,495 views
Skip to first unread message

Darin Clausing

unread,
Jul 7, 2014, 2:59:59 PM7/7/14
to google-ap...@googlegroups.com
Hello,

I am very new to GAM (and rusty with Python, so please go easy on me.) That being said, I am looking for a way to move 11,000 + chromebooks from the root OU into sub OUs. I currently have the serials numbers in csv broken down by the OUs I would like them to end up in (I discovered that GAM requires the device_id and not the serial number.)

Is this something I should be trying to do with GAM or should I be looking at going directly to a python script?

Thanks,
Darin

Jay Lee

unread,
Jul 8, 2014, 8:29:46 AM7/8/14
to google-ap...@googlegroups.com
To update one device, you can use a command like:

gam update cros query:id:<device serial number> ou "/Your OU"

to update multiple devices at once is possible but is going to take a bit more work. The easiest way would probably be to make copies of all your CSV files and then prefix the serial numbers in each row with "query:id:". Then you can run:

gam csv myfile.csv gam update cros ~serial ou "/New OU"

where myfile.csv is your CSV file and serial is the header of the column which contains "query:id:<serial#>" information.


Jay Lee


--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/0d026f6f-1e94-4caa-9532-a79143aa578f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Darin Clausing

unread,
Jul 9, 2014, 1:11:06 PM7/9/14
to google-ap...@googlegroups.com
Jay,

That works perfectly !! Thank you very much.

Darin


On Tuesday, July 8, 2014 5:29:46 AM UTC-7, Jay Lee wrote:
To update one device, you can use a command like:

gam update cros query:id:<device serial number> ou "/Your OU"

to update multiple devices at once is possible but is going to take a bit more work. The easiest way would probably be to make copies of all your CSV files and then prefix the serial numbers in each row with "query:id:". Then you can run:

gam csv myfile.csv gam update cros ~serial ou "/New OU"

where myfile.csv is your CSV file and serial is the header of the column which contains "query:id:<serial#>" information.


Jay Lee


On Mon, Jul 7, 2014 at 2:59 PM, Darin Clausing <claus...@gmail.com> wrote:
Hello,

I am very new to GAM (and rusty with Python, so please go easy on me.) That being said, I am looking for a way to move 11,000 + chromebooks from the root OU into sub OUs. I currently have the serials numbers in csv broken down by the OUs I would like them to end up in (I discovered that GAM requires the device_id and not the serial number.)

Is this something I should be trying to do with GAM or should I be looking at going directly to a python script?

Thanks,
Darin

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Larry Jones

unread,
Feb 25, 2015, 1:58:43 PM2/25/15
to google-ap...@googlegroups.com
I have tried to get the same command to work in our domain but have not had any luck.

I am trying to run the command:
c:\gam>gam csv c:\stecart.csv gam update cros ~serial ou "d49.org\students\stetson elementary\Stetson Testing Kiosk\Raider Cart #1"

"The response I get back is starting 5 worker threads" but nothing happens.

If anyone could help it would be appreciated.



On Tuesday, July 8, 2014 at 6:29:46 AM UTC-6, Jay Lee wrote:
To update one device, you can use a command like:

gam update cros query:id:<device serial number> ou "/Your OU"

to update multiple devices at once is possible but is going to take a bit more work. The easiest way would probably be to make copies of all your CSV files and then prefix the serial numbers in each row with "query:id:". Then you can run:

gam csv myfile.csv gam update cros ~serial ou "/New OU"

where myfile.csv is your CSV file and serial is the header of the column which contains "query:id:<serial#>" information.


Jay Lee


On Mon, Jul 7, 2014 at 2:59 PM, Darin Clausing <claus...@gmail.com> wrote:
Hello,

I am very new to GAM (and rusty with Python, so please go easy on me.) That being said, I am looking for a way to move 11,000 + chromebooks from the root OU into sub OUs. I currently have the serials numbers in csv broken down by the OUs I would like them to end up in (I discovered that GAM requires the device_id and not the serial number.)

Is this something I should be trying to do with GAM or should I be looking at going directly to a python script?

Thanks,
Darin

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Jay Lee

unread,
Feb 25, 2015, 3:54:07 PM2/25/15
to google-ap...@googlegroups.com
Those OU names do not look right. For starters, OUs use / as a delimiter not \. Try using:

gam print orgs

to get a list of OUs and how they should be specified in GAM commands.


Jay Lee

To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

Jim Looper

unread,
Nov 4, 2015, 4:54:43 PM11/4/15
to Google Apps Manager
If the devices need to go to different OU's can you call the OU field from the CSV file or does the OU have to be in the cmd line? Something like gam csv myfile.csv gam update cros ~serial ~OU. I couldn't get it to work.


On Tuesday, July 8, 2014 at 6:29:46 AM UTC-6, Jay Lee wrote:
To update one device, you can use a command like:

gam update cros query:id:<device serial number> ou "/Your OU"

to update multiple devices at once is possible but is going to take a bit more work. The easiest way would probably be to make copies of all your CSV files and then prefix the serial numbers in each row with "query:id:". Then you can run:

gam csv myfile.csv gam update cros ~serial ou "/New OU"

where myfile.csv is your CSV file and serial is the header of the column which contains "query:id:<serial#>" information.


Jay Lee


On Mon, Jul 7, 2014 at 2:59 PM, Darin Clausing <claus...@gmail.com> wrote:
Hello,

I am very new to GAM (and rusty with Python, so please go easy on me.) That being said, I am looking for a way to move 11,000 + chromebooks from the root OU into sub OUs. I currently have the serials numbers in csv broken down by the OUs I would like them to end up in (I discovered that GAM requires the device_id and not the serial number.)

Is this something I should be trying to do with GAM or should I be looking at going directly to a python script?

Thanks,
Darin

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

Ross Scroggs

unread,
Nov 4, 2015, 6:30:07 PM11/4/15
to google-ap...@googlegroups.com
Jim,

The command you want is: gam csv myfile.csv gam update cros ~serial ou ~OU
You were missing the ou keyword.

If serial really contains serial numbers, then you have to use Jay's trick where the serial column has entries like query:id:xxxyyyzzz.
If you actually have device IDs, then the serial column would just contain the ID, no query:id: prefix is required.

Ross

Ross

On Wed, Nov 4, 2015 at 11:25 AM, Jim Looper <jrlo...@aurorak12.org> wrote:
If the devices need to go to different OU's can you call the OU field from the CSV file or does the OU have to be in the cmd line? Something like gam csv myfile.csv gam update cros ~serial ~OU. I couldn't get it to work.

On Tuesday, July 8, 2014 at 6:29:46 AM UTC-6, Jay Lee wrote:
To update one device, you can use a command like:

gam update cros query:id:<device serial number> ou "/Your OU"

to update multiple devices at once is possible but is going to take a bit more work. The easiest way would probably be to make copies of all your CSV files and then prefix the serial numbers in each row with "query:id:". Then you can run:

gam csv myfile.csv gam update cros ~serial ou "/New OU"

where myfile.csv is your CSV file and serial is the header of the column which contains "query:id:<serial#>" information.


Jay Lee


On Mon, Jul 7, 2014 at 2:59 PM, Darin Clausing <claus...@gmail.com> wrote:
Hello,

I am very new to GAM (and rusty with Python, so please go easy on me.) That being said, I am looking for a way to move 11,000 + chromebooks from the root OU into sub OUs. I currently have the serials numbers in csv broken down by the OUs I would like them to end up in (I discovered that GAM requires the device_id and not the serial number.)

Is this something I should be trying to do with GAM or should I be looking at going directly to a python script?

Thanks,
Darin

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.



--

Jim Looper

unread,
Nov 5, 2015, 3:43:40 PM11/5/15
to Google Apps Manager
Thanks Ross,

It worked great.

Jim


Jay Lee


To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Google Apps Manager" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.



--

Peter Groman

unread,
Aug 11, 2020, 12:23:48 PM8/11/20
to GAM for G Suite

I'm trying this with this command
  • gam csvmyfile.csv gam cros  ~Serial update ou "Devices/my-ou-name"
and I get the error
  • ERROR: ou is not a valid argument for "gam <users> update"
How did you get yours to run with cros if ou is not a valid parameter??  My version is GAM 5.11

Ross Scroggs

unread,
Aug 11, 2020, 12:43:00 PM8/11/20
to google-ap...@googlegroups.com
Peter,

Did you try this?
gam csv myfile.csv gam update cros cros_sn  ~Serial ou "Devices/my-new-ou" 

Ross

You received this message because you are subscribed to the Google Groups "GAM for G Suite" 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/716cd1ca-8555-475c-8233-86acf9304f2bn%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages