GAM 4.03 - manage multiple Google domains

565 views
Skip to first unread message

Gary Kincaid

unread,
Dec 9, 2016, 1:31:39 PM12/9/16
to GAM for G Suite
We have several different Google domains, and with previous versions we could set up multiple instances of GAM in different directories to manage each domain.  I can't seem to get this to work with the new version. Is it even possible?

Thanks, Gary  

Jay Lee

unread,
Dec 9, 2016, 1:33:50 PM12/9/16
to GAM for G Suite

Just set the environment variable OAUTHFILE:

https://github.com/jay0lee/GAM/wiki/OAuthKeyManagement#selecting-which-oauth-key-file-to-use

Jay


On Fri, Dec 9, 2016, 1:31 PM Gary Kincaid <gkin...@boisestate.edu> wrote:
We have several different Google domains, and with previous versions we could set up multiple instances of GAM in different directories to manage each domain.  I can't seem to get this to work with the new version. Is it even possible?

Thanks, Gary  

--
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/6e59a108-df88-4bad-8bb4-ce8aa326da3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Jay

Paul Martin

unread,
Dec 13, 2016, 11:05:28 AM12/13/16
to GAM for G Suite
So within the ~/bin/gam directory, I would just run "gam create project" for each of the domains that I administer?  Will the client_secrets.json and oauth2.txt files get clobbered (assuming I've moved the oauth2service.json file out of the way)?

On Friday, December 9, 2016 at 1:33:50 PM UTC-5, Jay Lee wrote:
On Fri, Dec 9, 2016, 1:31 PM Gary Kincaid <gkin...@boisestate.edu> wrote:
We have several different Google domains, and with previous versions we could set up multiple instances of GAM in different directories to manage each domain.  I can't seem to get this to work with the new version. Is it even possible?

Thanks, Gary  

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

Jay

Ross Scroggs

unread,
Dec 13, 2016, 12:47:39 PM12/13/16
to google-ap...@googlegroups.com
Paul,

Assuming you already have a collection of client_secrets.json, oauth2.txt and oauth2service.json files, you can use the following environment variables.
OAUTHFILE - select oauth2.txt
OAUTHSERVICEFILE - select oauth2service.json
CLIENTSECRETS - select client_secrets.json.

You can have one instance of Gam in a directory and use the environment variables, or you can have multiple instances of gam in different directories as you did in the past; just copy the new gam.exe to your existing directories. You do not have to create any new projects.

Ross

On Tue, Dec 13, 2016 at 8:01 AM, Paul Martin <pma...@nmc.edu> wrote:
So within the ~/bin/gam directory, I would just run "gam create project" for each of the domains that I administer?  Will the client_secrets.json and oauth2.txt files get clobbered (assuming I've moved the oauth2service.json file out of the way)?

On Friday, December 9, 2016 at 1:33:50 PM UTC-5, Jay Lee wrote:
On Fri, Dec 9, 2016, 1:31 PM Gary Kincaid <gkin...@boisestate.edu> wrote:
We have several different Google domains, and with previous versions we could set up multiple instances of GAM in different directories to manage each domain.  I can't seem to get this to work with the new version. Is it even possible?

Thanks, Gary  

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

Jay

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



--

Paul Martin

unread,
Dec 13, 2016, 12:55:17 PM12/13/16
to google-ap...@googlegroups.com
Thanks for the prompt reply. Unfortunately, due to this, that, and some of the other, I no longer have any of the old files.

Right now, my first domain is all set up with GAM4 now and working flawlessly.  In the install directory, I re-ran "gam create project" and ran through the steps again, but this time for my second domain.  It ran through the process again just fine, but when I look in the directory, I now have an oauth2service.json and a client_secrets.json with the project name appended (in addition to the regular files for the first domain), but no new oauth2.txt.  I'd like to keep everything in one directory instead of maintaining two installs, which is why I'm attempting it this way.  What would be the quickest way to get my second domain up and running?  Should I just set it up in a new directory, and then copy the relevant files to the working directory, or...?


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.



--

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

Ross Scroggs

unread,
Dec 13, 2016, 1:02:54 PM12/13/16
to google-ap...@googlegroups.com
Paul,

Move the oauth2service.json-xxx and client_secrets.json-xxx files to the proper directory and strip the -xxx.
In each directory, do this to recreate oauth2.txt: gam oauth create
For subsequent domains, do gam create project/gam oauth create in the appropriate directory.

Ross

To unsubscribe from this group and all its topics, 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.

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



--

Jay Lee

unread,
Dec 13, 2016, 1:03:34 PM12/13/16
to google-ap...@googlegroups.com
There's rarely a need to create separate oauth2service.json and client_secrets.json files per-G Suite instance. Just setup the first like you've done and then switch between OAuth files:


you can authorize the service account to act on behalf of each domains users by running:

gam user a_user@a_domain.com check serviceaccount

and following the provided instructions for each domain.

Jay

On Tue, Dec 13, 2016 at 12:55 PM Paul Martin <pma...@nmc.edu> wrote:
Thanks for the prompt reply. Unfortunately, due to this, that, and some of the other, I no longer have any of the old files.

Right now, my first domain is all set up with GAM4 now and working flawlessly.  In the install directory, I re-ran "gam create project" and ran through the steps again, but this time for my second domain.  It ran through the process again just fine, but when I look in the directory, I now have an oauth2service.json and a client_secrets.json with the project name appended (in addition to the regular files for the first domain), but no new oauth2.txt.  I'd like to keep everything in one directory instead of maintaining two installs, which is why I'm attempting it this way.  What would be the quickest way to get my second domain up and running?  Should I just set it up in a new directory, and then copy the relevant files to the working directory, or...?


On Tue, Dec 13, 2016 at 12:47 PM, Ross Scroggs <ross.s...@gmail.com> wrote:
Paul,

Assuming you already have a collection of client_secrets.json, oauth2.txt and oauth2service.json files, you can use the following environment variables.
OAUTHFILE - select oauth2.txt
OAUTHSERVICEFILE - select oauth2service.json
CLIENTSECRETS - select client_secrets.json.

You can have one instance of Gam in a directory and use the environment variables, or you can have multiple instances of gam in different directories as you did in the past; just copy the new gam.exe to your existing directories. You do not have to create any new projects.

Ross
On Tue, Dec 13, 2016 at 8:01 AM, Paul Martin <pma...@nmc.edu> wrote:
So within the ~/bin/gam directory, I would just run "gam create project" for each of the domains that I administer?  Will the client_secrets.json and oauth2.txt files get clobbered (assuming I've moved the oauth2service.json file out of the way)?

On Friday, December 9, 2016 at 1:33:50 PM UTC-5, Jay Lee wrote:
On Fri, Dec 9, 2016, 1:31 PM Gary Kincaid <gkin...@boisestate.edu> wrote:
We have several different Google domains, and with previous versions we could set up multiple instances of GAM in different directories to manage each domain.  I can't seem to get this to work with the new version. Is it even possible?

Thanks, Gary  

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

Jay

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



--

--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/96Kb2e7K8-0/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 https://groups.google.com/group/google-apps-manager.

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

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

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

Jay

Paul Martin

unread,
Dec 13, 2016, 2:41:09 PM12/13/16
to google-ap...@googlegroups.com
Much appreciated to both of you, I got it working.  Well, mostly.  I don't know if I should open another topic for this, so just tell me if I should.

When I run

gam user [REGULARACCOUNT]@[DOMAINNAME] show forwardingaddress

I get:

ERROR: user [REGULARACCOUNT]@[DOMAINNAME]: unauthorized_client: Unauthorized client or scope in request.
User: [REGULARACCOUNT]@[DOMAINNAME], Forwarding Addresses: (1/1)

However, when I run

gam user [ADMINACCOUNT]@[DOMAINNAME] check serviceaccount

to verify scope authorization, I get:

User: [ADMINACCOUNT]@[DOMAINNAME]
 Scope: https://mail.google.com/                                     PASS
 Scope: https://www.googleapis.com/auth/activity                     PASS
 Scope: https://www.googleapis.com/auth/calendar                     PASS
 Scope: https://www.googleapis.com/auth/drive                        PASS
 Scope: https://www.googleapis.com/auth/plus.me                      PASS

So I'm somewhat stumped.  It appears as though I have everything set up correctly, yet I'm still getting the Unauthorized error.

Any thoughts?


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

Jay

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



--

--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/96Kb2e7K8-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.

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

Jay

--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/96Kb2e7K8-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-manager+unsub...@googlegroups.com.
To post to this group, send email to google-apps-manager@googlegroups.com.

Ross Scroggs

unread,
Dec 13, 2016, 3:09:38 PM12/13/16
to google-ap...@googlegroups.com
Paul,

What is the output from: gam user [REGULARACCOUNT]@[DOMAINNAME] check serviceaccount

Ross

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

Jay

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



--

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

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

Jay

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

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



--

Paul Martin

unread,
Dec 13, 2016, 3:15:38 PM12/13/16
to google-ap...@googlegroups.com
Oh, for the love of...

That did it.  Thank you.





--

--
You received this message because you are subscribed to a topic in the Google Groups "GAM for G Suite" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-manager/96Kb2e7K8-0/unsubscribe.
To unsubscribe from this group and all its topics, 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.
Reply all
Reply to author
Forward
0 new messages