Google Spreadsheet template to help create GAM commands to bulk add users, add groups and move to Org

3,927 views
Skip to first unread message

Bjorn Behrendt

unread,
Apr 18, 2012, 9:51:00 PM4/18/12
to google-ap...@googlegroups.com
I just created this google sheet which I turned into a public template.   Basically you enter the user info and Org and the sheet will create the correct GAM syntax text that you can then just copy and past into a command line and GAM will do the rest.   I would not call this a polished solution and make sure you double-check the snytax (for example the first time I used this for a client accidently added everyone's email as their First name).

Link to template: http://goo.gl/ClioE

The command line text is broken up into 6 different steps
1. Connect with gam
2. Add Groups
3. Add Org's ~ This one I was not able to automate as each parent org needs to be created before any sub orgs
4. Add Users ~ Do this step and then walk away for a day.  Rushing this step only causes more issues as it takes up to 24hrs to completely add users.
5. Add Users to groups
6a. Add users to Org via groups ~ Half of my users worked this way and half didn't, I am not sure why.
6b. Add users to Org via Username ~ was a little more reliable.

Enjoy
Bjorn Behrendt
http://www.edlisten.com/  ~ home of the Google Weekly Podcast ~ Never Stop Learning

Jay Lee

unread,
Apr 19, 2012, 7:42:44 AM4/19/12
to google-ap...@googlegroups.com
Hi Bjorn,

  That's awesome! Great use of Google Docs to simplify the process!

Regards,

Jay Lee
LCS Deployment Lead  | Dito
(267) 712-9533
j...@ditoweb.com





--
You received this message because you are subscribed to the "Google Apps Manager" group.
To post to this group, send email to
google-ap...@googlegroups.com
To unsubscribe from this group, send email to
google-apps-man...@googlegroups.com
For more options, visit this group at
https://groups.google.com/forum/#!forum/google-apps-manager

Schmidt, Randal

unread,
Apr 19, 2012, 8:18:03 AM4/19/12
to google-ap...@googlegroups.com
Nice work, Bjorn.  Thank you for sharing.  It fuels ideas for more uses of GAM.

Randy Schmidt

IT Operations - BCP Specialist

-----------------------------------------------------------

Direct 641-357-2710 ext 2229

 

TeamQuest Corporation

641-357-2700

teamquest.com | LinkedIn | ITSO Blog

------------------------------------------------------------

Specializing in IT Capacity Management




--

Gregory Relaford

unread,
Apr 19, 2012, 1:45:15 PM4/19/12
to google-ap...@googlegroups.com
You rock!
--
GregR

David Miller

unread,
Jul 11, 2014, 7:53:23 AM7/11/14
to google-ap...@googlegroups.com
This is great. I do similar things to update user phone numbers, addresses, etc. I'm having trouble, though, with adding and external email address. From the google help I see that that it should have these parameters::
  emails:
    {
      address: "na...@sample.org",
      type: "home",
      customType: "",
      primary: false
    }  
So what should my command line should look like?


This electronic message contains information from the sender that is intended only for the use of the addressee and may contain information that is privileged, confidential and protected under the Education Act and the Freedom of Information and Protection of Privacy Act. The dissemination of this information is strictly prohibited. If you have received this electronic transmission in error, please contact the sender immediately. 

Jay Lee

unread,
Jul 11, 2014, 8:11:24 AM7/11/14
to google-ap...@googlegroups.com
Make sure you're using the latest 3.31 release and try:

gam update user <primaryemail> otheremail home myad...@gmail.com


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/f828937a-a923-4183-92c5-d79677e0c3d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Miller

unread,
Jul 11, 2014, 10:25:56 AM7/11/14
to google-ap...@googlegroups.com
I'm running a Mac with version 3.21. I don't see a download for 3.31 for the Mac.

So I guess I'll need to wait for the OSX version.


On Fri, Jul 11, 2014 at 8:11 AM, Jay Lee <jay...@gmail.com> wrote:
gam update user <primaryemail> otheremail home myad...@gmail.com



David T Miller
Technology Director
Vision International School
PO Box 875
Al Saad St.,
Doha, Qatar
Cell Phone:             905-321-0011
Skype:                   DavidTMiller
Google Hangout:     David....@visqatar.org


James Hatz

unread,
Aug 19, 2014, 4:38:27 PM8/19/14
to google-ap...@googlegroups.com
Bjorn this is great - wish I only had found it sooner :) Thanks - great tool for the ol toolbox. 

Shane Jacobson

unread,
Aug 26, 2014, 12:11:22 PM8/26/14
to google-ap...@googlegroups.com
Hello, I am new to GAM.  I help manage the Google apps for Education system for our school district.  I am wanting to bulk import students into our system.  I can import with the csv using the management console but it puts all the users at the top most org and them moving them is a pain in the neck.  I would like to be able to just import students right into the organization of my choice.

I can follow your post here and I like the spreadsheet you created but, I am not sure what the gam command is to bulk add the users into the system into the org of my choice.  I see in your spreadsheet how it auto populates the gam commands for you but, I can't figure out how to batch run all those commands.  I have searched through and read many posts but I can't find where it explains that part.

I am using a Win7 64-bit workstation, I followed the GAM setup and it seems to function like it is supposed to, I can run the commands in the examples anyway.  I just want to be able to build a spreadsheet or text file and run a gam command that does an import based on the info in the spreadsheet.  Thank you for your time.

Brian Gray

unread,
Aug 26, 2014, 9:03:49 PM8/26/14
to google-ap...@googlegroups.com


On Tuesday, August 26, 2014 11:11:22 AM UTC-5, Shane Jacobson wrote:
Hello, I am new to GAM.  I help manage the Google apps for Education system for our school district.  I am wanting to bulk import students into our system.  I can import with the csv using the management console but it puts all the users at the top most org and them moving them is a pain in the neck.  I would like to be able to just import students right into the organization of my choice.

I can follow your post here and I like the spreadsheet you created but, I am not sure what the gam command is to bulk add the users into the system into the org of my choice.  I see in your spreadsheet how it auto populates the gam commands for you but, I can't figure out how to batch run all those commands.  I have searched through and read many posts but I can't find where it explains that part.


My shared folder of GAM examples - http://goo.gl/EdnvaO - has a file Create one or many users with GAM.  It shows the syntax for creating a single user and the syntax for creating many users listed in a CSV file.


Shane Jacobson

unread,
Aug 27, 2014, 9:07:52 AM8/27/14
to google-ap...@googlegroups.com
Thanks, just what I was looking for!


--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/QvpIJlLnbZU/unsubscribe.
To unsubscribe from this group and all its topics, 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.



--
Shane Jacobson 
Network Engineer 
Walla Walla Public Schools
364 South Park St.
Walla Walla, WA 99362

Kim Nilsson

unread,
Oct 29, 2014, 12:42:08 PM10/29/14
to google-ap...@googlegroups.com
Hey, Bjorn!

Is this your most updated version of this template?
You don't have super-duper-mega-improved version saved elsewhere? :-)

Yes, I've grabbed Brian's folder of templates too. Can't have too much help when learning how to administer a GAFE domain.

Regards,
/Kim

Bjorn Behrendt

unread,
Oct 29, 2014, 12:53:07 PM10/29/14
to google-ap...@googlegroups.com
I have not touched or needed to touch that is quite a while.   The concept should still work and have the sheet create the context for you.


Bjorn Behrendt M.Ed ~ Never Stop Learning
   Google Apps For Education Certified Trainer & Administrator
My Sites
 ~ Edlisten.com Educational Podcast
 ~ AskBj.net ~ Online Training and Ed Tech Resources
 ~ VTed.org ~ Vermont's Personal Learning Network

gClassFolders ~ Create Google folders for your class.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/QvpIJlLnbZU/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Kim Nilsson

unread,
Oct 29, 2014, 2:44:51 PM10/29/14
to google-ap...@googlegroups.com
Yup, looks like it.

However, for a larger domain the lists of commands will be quite long. It's going to be tough to copy/paste  them.
Have you considered including some pointers on how to do this with either batch commands or CSV?

Maybe that's the domain of Brian Gray or Jay Lee? :-)

/Kim

Bjorn Behrendt

unread,
Oct 29, 2014, 3:01:06 PM10/29/14
to google-ap...@googlegroups.com
I started trying to script it during a workshop last July but didn't get very far.   Based on that workshop the method I was using, in creating a spreadsheet with commands to paste into a command line was one of the best methods. 

First get GAM working and go through the process of creating a single user & group.   Basically make sure it works and you know what syntex and steps you will need to do.

Once you get GAM working, just update my sheet template with the new syntax formula's and paste the column into the command line.



Bjorn Behrendt M.Ed ~ Never Stop Learning
   Google Apps For Education Certified Trainer & Administrator
My Sites
 ~ Edlisten.com Educational Podcast
 ~ AskBj.net ~ Online Training and Ed Tech Resources
 ~ VTed.org ~ Vermont's Personal Learning Network

gClassFolders ~ Create Google folders for your class.

--
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Manager" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/QvpIJlLnbZU/unsubscribe.
To unsubscribe from this group and all its topics, 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.

Shane Jacobson

unread,
Oct 29, 2014, 3:05:09 PM10/29/14
to google-ap...@googlegroups.com
For what it is worth, I ended up making a 2 sheet spreadsheet google doc so I could paste my large amount of user data (user first name, last name, email address, password I wanted) into the second sheet and it would auto populate the first sheet the way GAM wanted it, save the sheet in the GAM files folder, I would then run the GAM commands referencing that sheet.


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

Brian Gray

unread,
Oct 29, 2014, 6:23:25 PM10/29/14
to google-ap...@googlegroups.com


On Wednesday, October 29, 2014 1:44:51 PM UTC-5, Kim Nilsson wrote:

However, for a larger domain the lists of commands will be quite long. It's going to be tough to copy/paste  them.
Have you considered including some pointers on how to do this with either batch commands or CSV?

Maybe that's the domain of Brian Gray or Jay Lee? :-)


I haven't updated my docs to include much of the more-recent bulk operations because I think the wiki does a good job documenting them now.  There is a little bit about it in one of my docs, but it's mainly a there as a reminder to myself.

Bryan Guidroz

unread,
Jul 24, 2015, 3:21:20 AM7/24/15
to Google Apps Manager, Jay Lee
I'm looking to do something similar.  I'd like to update the "Secondary email address" field but I can't figure out the syntax.  Any suggestion on how to update these fileds?  I was able to add the employee id using "externalid organization ~EmploeeID" but can't figure out how to get the secondary email address added.
Reply all
Reply to author
Forward
0 new messages