Bulk Operations - Creating Organizational Units

864 views
Skip to first unread message

Rick Garcia

unread,
Feb 13, 2017, 7:03:04 PM2/13/17
to GAM for G Suite
Hello,

I'm trying to create several organizational units(sub) using a text file with the following gam command:

gam batch Security-Groups.txt

The text file contains the following commands per organization:

gam create org "Accounting Department" parent /Users/AD
gam create org "Accounting MGRs" parent /Users/AD
gam create org "Accounting Payroll Manager" parent /Users/AD
gam create org "Admin Department" parent /Users/AD
gam create org "Administrative Assistants" parent /Users/AD
gam create org "AFM Department" parent /Users/AD

The following error message appears when I try and run the batch command:

Using 2 processes...
gam.py:6467: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
gam.py:6467: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
ERROR: Assistants” is not a valid argument for "gam create org"
ERROR: Department” is not a valid argument for "gam create org"

If I were to put those commands in one-by-one, they work but they don't work with the batch command. Is there a limitation of how many OU's I can create at a time? I cannot seem to find anywhere that states that that is the case. Any help would be greatly appreciated. Thank You.

Ross Scroggs

unread,
Feb 13, 2017, 7:09:43 PM2/13/17
to google-ap...@googlegroups.com
Rick,

Please post: gam version

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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/7d03ad0f-023f-4645-8e5d-eaa2f78be7c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kevin Melillo

unread,
Feb 14, 2017, 8:09:26 AM2/14/17
to google-ap...@googlegroups.com
I am not sure if this would work for you, but I would use the CSV command.  I believe the batch command is meant for running different commands, all in one go..  since you will be running the same command with different data, you should use the CSV command.

gam csv org_list.csv gam create org ~newOrg ~parentOrg

I would then create the CSV as follows

org_list.csv
parent,newOrg
/Users/AD,Accounting Department
/Users/AD,Accounting MGRs

Let me know if this works for you.

Thanks.

On Mon, Feb 13, 2017 at 7:09 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Rick,

Please post: gam version

Ross
On Mon, Feb 13, 2017 at 3:56 PM, Rick Garcia <rick.garcia@royaltechnologies.com> wrote:
Hello,

I'm trying to create several organizational units(sub) using a text file with the following gam command:

gam batch Security-Groups.txt

The text file contains the following commands per organization:

gam create org "Accounting Department" parent /Users/AD
gam create org "Accounting MGRs" parent /Users/AD
gam create org "Accounting Payroll Manager" parent /Users/AD
gam create org "Admin Department" parent /Users/AD
gam create org "Administrative Assistants" parent /Users/AD
gam create org "AFM Department" parent /Users/AD

The following error message appears when I try and run the batch command:

Using 2 processes...
gam.py:6467: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
gam.py:6467: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
ERROR: Assistants” is not a valid argument for "gam create org"
ERROR: Department” is not a valid argument for "gam create org"

If I were to put those commands in one-by-one, they work but they don't work with the batch command. Is there a limitation of how many OU's I can create at a time? I cannot seem to find anywhere that states that that is the case. Any help would be greatly appreciated. Thank You.

--
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-manager+unsubscribe...@googlegroups.com.



--

--
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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

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



--
Kevin Melillo
Electronic Communications Analyst
Information Technology
445 Hoes Lane
Piscataway, NJ 08854

Phone:732-465-6609 | Mobile: 732-609-4331

Rick Garcia

unread,
Feb 14, 2017, 8:53:52 AM2/14/17
to GAM for G Suite
Ross, i'm running the latest version of GAM 4.11. I actually figured it out. Though the error is not clear regarding the which unicode characters are specifically not recognized, I ended up copying and pasting a command into the text file from the github and modified it to what I needed. Turns out it was the font that was affecting it. I believe the quotation marks had to be something specific...I really don't know. But after copying and pasting it worked like a charm. Honestly, I do appreciate the quick response and your effort to help me with this issue. I'm new to this and i'm making every effort to understand it. Thanks again.

To post to this group, send email to google-ap...@googlegroups.com.



--
GAM Version.png
batch results.png

Rick Garcia

unread,
Feb 14, 2017, 8:56:23 AM2/14/17
to GAM for G Suite
Kevin,

I actually figured it out. Though the error is not clear regarding the which unicode characters are specifically not recognized, I ended up copying and pasting a command into the text file from the github and modified it to what I needed. Turns out it was the font that was affecting it. I believe the quotation marks had to be something specific...I really don't know. But after copying and pasting it worked like a charm. I will give your recommendation a shot though as I was also trying to use a CSV and could not get it to work. Honestly, I do appreciate the quick response and your effort to help me with this issue. I'm new to this and i'm making every effort to understand it. Thanks again. 


On Tuesday, February 14, 2017 at 7:09:26 AM UTC-6, k.melillo wrote:
I am not sure if this would work for you, but I would use the CSV command.  I believe the batch command is meant for running different commands, all in one go..  since you will be running the same command with different data, you should use the CSV command.

gam csv org_list.csv gam create org ~newOrg ~parentOrg

I would then create the CSV as follows

org_list.csv
parent,newOrg
/Users/AD,Accounting Department
/Users/AD,Accounting MGRs

Let me know if this works for you.

Thanks.
On Mon, Feb 13, 2017 at 7:09 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Rick,

Please post: gam version

Ross
On Mon, Feb 13, 2017 at 3:56 PM, Rick Garcia <rick....@royaltechnologies.com> wrote:
Hello,

I'm trying to create several organizational units(sub) using a text file with the following gam command:

gam batch Security-Groups.txt

The text file contains the following commands per organization:

gam create org "Accounting Department" parent /Users/AD
gam create org "Accounting MGRs" parent /Users/AD
gam create org "Accounting Payroll Manager" parent /Users/AD
gam create org "Admin Department" parent /Users/AD
gam create org "Administrative Assistants" parent /Users/AD
gam create org "AFM Department" parent /Users/AD

The following error message appears when I try and run the batch command:

Using 2 processes...
gam.py:6467: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
gam.py:6467: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
ERROR: Assistants” is not a valid argument for "gam create org"
ERROR: Department” is not a valid argument for "gam create org"

If I were to put those commands in one-by-one, they work but they don't work with the batch command. Is there a limitation of how many OU's I can create at a time? I cannot seem to find anywhere that states that that is the case. Any help would be greatly appreciated. Thank You.

--
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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.



--

--
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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
batch results.png

Ross Scroggs

unread,
Feb 14, 2017, 9:01:58 AM2/14/17
to google-ap...@googlegroups.com
Rick,

Any time you create a batch/csv file, you want it as plain as possible.

Here is a correction to Kevin's suggestion.

 I would then create the CSV as follows

org_list.csv
parent,newOrg
/Users/AD,Accounting Department
/Users/AD,Accounting MGRs

gam csv org_list.csv gam create org "~newOrg" parent "~parent"

Put " around ~newOrg and ~parent, you need the parent argument in front of "~parent"

Ross
--





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 https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.
<batch results.png>

Kevin Melillo

unread,
Feb 14, 2017, 9:03:46 AM2/14/17
to google-ap...@googlegroups.com
Whoops!  It pays to have my coffee before replying!  Thank you.

On Tue, Feb 14, 2017 at 9:01 AM, Ross Scroggs <ross.s...@gmail.com> wrote:
Rick,

Kevin,

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



-- 

-- 
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-manager+unsubscri...@googlegroups.com.

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



-- 
Kevin Melillo
Electronic Communications Analyst
Information Technology
445 Hoes Lane
Piscataway, NJ 08854

Phone:732-465-6609 | Mobile: 732-609-4331
E-mail: k.me...@ieee.org


-- 
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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.
<batch results.png>

--
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-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages