update org by file very slow or fail in gam 3.x

168 views
Skip to first unread message

DIEGO GONZALEZ ESPINILLA

unread,
Jul 8, 2014, 5:44:42 AM7/8/14
to google-ap...@googlegroups.com
Hi.

In gam version 2.55, move 100 mailboxes to any org takes 2 seconds.

In gam 3.x, including 3.3, the same operation takes more than 5 minutes or fail and dont move any mailboxes.

Regards.

Jay Lee

unread,
Jul 8, 2014, 8:02:03 AM7/8/14
to google-ap...@googlegroups.com
Yes, the old Provisioning API allowed up to 25 users to be moved into an OU with a single API call. With the new Admin SDK, it's an API operation per-user to move them. However, a few things:
  • The new Admin SDK allows you to set user OU at the same time a user is created or other updates are made to a user (like setting their password or phone number) and it's still just 1 API call. If possible, I recommend setting the user's API call at this time.

  • You can use the new GAM 3.2+ batch and csv commands to speed up these processes. They are documented here. Assuming you have the list of 100 users in a CSV you can do:

    gam csv users2move.csv gam update user ~email ou "/NewOU"

    where users2move.csv is a CSV file with headers which has a header row of email with all user emails to move defined. This should be much faster as GAM will start 5 child processes to perform the moves in parallel.
If you're still getting errors, I need to know the exact error message you're getting to be able to do anything with it.


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/5e069c0c-b4a4-483b-973e-35e3a66639b1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

DIEGO GONZALEZ ESPINILLA

unread,
Jul 9, 2014, 2:49:49 AM7/9/14
to google-ap...@googlegroups.com
Thanks Jay.

I used the batch option and it worked perfectly although still slower than before.

In the batch option, can I use with print command?:

File print.txt
gam print users ou > users.csv
gam print licenses > licenses.csv

And gam command:

.\gam.exe batch .\print.txt

In powershell give me this error:

PS C:\GAM33> .\gam.exe batch .\print.txt
starting 20 worker threads...
Error: > is not a valid argument to gam print licenses
Dito GAM 3.3 - http://git.io/gam
Python 2.7.8 32-bit final
google-api-python-client 1.2
Windows-7-6.1.7601-SP1 x86
Path: c:\gam33\

Usage: gam [OPTIONS]...

Dito GAM. Retrieve or set Google Apps domain,
user, group and alias settings. Exhaustive list of commands

Examples:
gam info domain
gam create user jsmith firstname John lastname Smith password secretpass
gam update user jsmith suspended on
gam.exe update group announcements add member jsmith
...


Traceback (most recent call last):
  File "gam.py", line 6996, in <module>
  File "gam.py", line 5431, in doPrintUsers
NameError: global name 'exit' is not defined

Thanks.

El martes, 8 de julio de 2014 14:02:03 UTC+2, Jay Lee escribió:
Yes, the old Provisioning API allowed up to 25 users to be moved into an OU with a single API call. With the new Admin SDK, it's an API operation per-user to move them. However, a few things:
  • The new Admin SDK allows you to set user OU at the same time a user is created or other updates are made to a user (like setting their password or phone number) and it's still just 1 API call. If possible, I recommend setting the user's API call at this time.

  • You can use the new GAM 3.2+ batch and csv commands to speed up these processes. They are documented here. Assuming you have the list of 100 users in a CSV you can do:

    gam csv users2move.csv gam update user ~email ou "/NewOU"

    where users2move.csv is a CSV file with headers which has a header row of email with all user emails to move defined. This should be much faster as GAM will start 5 child processes to perform the moves in parallel.
If you're still getting errors, I need to know the exact error message you're getting to be able to do anything with it.


Jay Lee


On Tue, Jul 8, 2014 at 5:44 AM, DIEGO GONZALEZ ESPINILLA <diego.gonzal...@bbva.com> wrote:
Hi.

In gam version 2.55, move 100 mailboxes to any org takes 2 seconds.

In gam 3.x, including 3.3, the same operation takes more than 5 minutes or fail and dont move any mailboxes.

Regards.

--
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,
Jul 9, 2014, 7:47:54 AM7/9/14
to google-ap...@googlegroups.com
You can't redirect within a batch like this. You'll need to do the redirect on the command line.


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.
Reply all
Reply to author
Forward
0 new messages