Adding a calendar to all users in OU and Sub OUs

1,454 views
Skip to first unread message

Steve Larsen

unread,
Dec 14, 2016, 8:54:05 AM12/14/16
to GAM for G Suite
What would be the best way to run a single command like this for all the sub-ou under it. There are 50 under this top level org for example.

gam ou "/Top OU" add calendar domain.com_skaI...@group.calendar.google.com selected true colorindex 3

Ross Scroggs

unread,
Dec 14, 2016, 9:01:44 AM12/14/16
to google-ap...@googlegroups.com
Steve,

gam ou_and_children "/Top OU" add calendar domain.com_skaI...@group.calendar.google.com selected true colorindex 3

On Dec 14, 2016, at 5:54 AM, Steve Larsen <steve....@gettaxi.com> wrote:

What would be the best way to run a single command like this for all the sub-ou under it. There are 50 under this top level org for example.

gam ou "/Top OU" add calendar domain.com_skaI...@group.calendar.google.com selected true colorindex 3

--
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 post to this group, send email to google-ap...@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/1c180198-17c0-4a3f-a590-ac986c9a65f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Steve Larsen

unread,
Dec 21, 2016, 9:26:30 AM12/21/16
to GAM for G Suite
thanks for that. seems to now be breaking at a suspended user. can notsuspended be used for example?

gam ou_and_children "/Top OU" add calendar notsuspended domain.com_skaIVTLKCojXbN2yNyEh@group.calendar.google.com selected true colorindex 3

On Wednesday, 14 December 2016 14:01:44 UTC, Ross Scroggs wrote:
Steve,

gam ou_and_children "/Top OU" add calendar domain.com_skaIVTLKCojXbN2yNyEh@group.calendar.google.com selected true colorindex 3

Ross Scroggs

unread,
Dec 21, 2016, 10:59:20 AM12/21/16
to google-ap...@googlegroups.com
Steve,

I can do something long term, in the short term do this:
1) gam ou_and_children "/Top OU" print > users.csv
2) edit users.csv and add a header row: User
3) gam csv users.csv gam user "~User" add calendar domain.com_skaIVTLKCojXbN2yNyEh...@group.calendar.google.com selected true color index 3

As each user is processed separately, the error won't stop you.

Ross

On Wed, Dec 21, 2016 at 6:26 AM, Steve Larsen <steve....@gettaxi.com> wrote:
thanks for that. seems to now be breaking at a suspended user. can notsuspended be used for example?

gam ou_and_children "/Top OU" add calendar notsuspended domain.com_skaIVTLKCojXbN2yNyEh@group.calendar.google.com selected true colorindex 3

On Wednesday, 14 December 2016 14:01:44 UTC, Ross Scroggs wrote:
Steve,

gam ou_and_children "/Top OU" add calendar domain.com_skaIVTLKCojXbN2yNyEh...@group.calendar.google.com selected true colorindex 3

--
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.



--

Ross Scroggs

unread,
Dec 21, 2016, 1:32:58 PM12/21/16
to google-ap...@googlegroups.com
Steve,

I've updated my version of GAM to handle the error: https://github.com/taers232c/GAM/releases
Users with no calendar access get an error message but gam continues.
It's a drop-in replacement.

Ross

On Wed, Dec 21, 2016 at 7:59 AM, Ross Scroggs <ross.s...@gmail.com> wrote:
Steve,

I can do something long term, in the short term do this:
1) gam ou_and_children "/Top OU" print > users.csv
2) edit users.csv and add a header row: User
3) gam csv users.csv gam user "~User" add calendar domain.com_skaIVTLKCojXbN2yNyEh@group.calendar.google.com selected true color index 3

As each user is processed separately, the error won't stop you.

Ross
On Wed, Dec 21, 2016 at 6:26 AM, Steve Larsen <steve....@gettaxi.com> wrote:
thanks for that. seems to now be breaking at a suspended user. can notsuspended be used for example?

gam ou_and_children "/Top OU" add calendar notsuspended domain.com_skaIVTLKCojXbN2yNyEh@group.calendar.google.com selected true colorindex 3

On Wednesday, 14 December 2016 14:01:44 UTC, Ross Scroggs wrote:
Steve,

gam ou_and_children "/Top OU" add calendar domain.com_skaIVTLKCojXbN2yNyEh...@group.calendar.google.com selected true colorindex 3

--
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.

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.



--



--

+KimNilsson

unread,
Dec 23, 2016, 3:15:57 AM12/23/16
to GAM for G Suite
Error handling takes care of calendars already added too, I assume?
I mean, for when you run the command the second or twenty-third time.

Jay Strumwasser

unread,
Aug 31, 2017, 11:17:24 AM8/31/17
to GAM for G Suite
I just triedand could not get it towork. cananyone pm me?

On Friday, December 23, 2016 at 3:15:57 AM UTC-5, +KimNilsson wrote:
Error handling takes care of calendars already added too, I assume?
I mean, for when you run the command the second or twenty-third time.

Challenge Preparatory Charter School Corporate Office
710 Hartman Lane
Far Rockaway, NY 11691

This is a staff email account managed by Challenge Preparatory Charter School.  This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender.

+KimNilsson

unread,
Sep 1, 2017, 2:45:18 AM9/1/17
to GAM for G Suite
Hi, Jay!

Did you use Ross' version of GAM?
I'm not sure regular GAM will manage this.

Jay Strumwasser

unread,
Sep 1, 2017, 7:37:53 AM9/1/17
to GAM for G Suite
As far as I know I have the latest version of GAM, how can I check that?

Kim Nilsson

unread,
Sep 1, 2017, 7:57:52 AM9/1/17
to Google Apps Manager
Ross' GAM is not the same.
You can find it here.

Jay Strumwasser

unread,
Sep 1, 2017, 9:28:26 AM9/1/17
to GAM for G Suite
Thank you, once I download this, should I just add it to my C:/gam folder?  I am not sure how to do this, I had a third-party company assist me with this in the past (amplified IT)

Thanks!

Kim Nilsson

unread,
Sep 1, 2017, 9:59:44 AM9/1/17
to Google Apps Manager
No, put it in a separate folder.
Like C: / GAMX

You can copy your two .json files to a folder called C: / Users / YourUser / .gam

Go to C: / GAMX
And then run ./gam create oauth

I think that should be enough.

Jay Strumwasser

unread,
Sep 1, 2017, 12:11:53 PM9/1/17
to GAM for G Suite
Not working....


c:\gam-64>gam printcourses todrive
WARNING: Config File: C:\Users\jstru\.gam\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\Users\jstru\.gam\oauth2.txt, Not Found
WARNING: Config File: C:\Users\jstru\.gam\gam.cfg, Section: DEFAULT, Item: oauth2service_json, Value: C:\Users\jstru\.gam\oauth2service.json, Not Found
WARNING: Config File: C:\Users\jstru\.gam\gam.cfg, Section: DEFAULT, Item: client_secrets_json, Value: C:\Users\jstru\.gam\client_secrets.json, Not Found
Command: gam >>>printcourses<<< todrive

ERROR: Unknown command or selector
Help: Syntax in file c:\gam-64\GamCommands.txt

Jay Strumwasser

unread,
Sep 1, 2017, 12:14:31 PM9/1/17
to GAM for G Suite
Disregard previous



New error:
c:\gam-64>gam create oauth
Command: gam create >>>oauth<<<

ERROR: Invalid argument: Expected <admin|aliases|contact|course|datatransfer|domain|domainalias|group|guardian|org|project|resoldcustomer|resoldsubscription|resource|schema|site|user|vaulthold|vaultmatter|verify>
Help: Syntax in file c:\gam-64\GamCommands.txt

Kim Nilsson

unread,
Sep 2, 2017, 2:24:47 PM9/2/17
to Google Apps Manager
My bad.

gam oauth create
Reply all
Reply to author
Forward
0 new messages