Gam for Dynamic google groups

2,078 views
Skip to first unread message

Dennis Mattei

unread,
Jun 19, 2018, 5:01:49 PM6/19/18
to GAM for G Suite
Hey guys,

Has anyone used gam to update groups dynamically 

scenario 

If user is in OU A, then add to email group a.

if user is not in OU A then remove from email group a

so forth...

using a server this could run nightly, and keep groups up to date.



This message contains information which may be confidential and/or protected by attorney-client privilege.  Unless you are the addressee, you may not use, copy or disclose to anyone this message or any information contained in this message.  If you have received this message in error, please send me an email and delete this message.   Thank you.

Andrew Penner

unread,
Jun 19, 2018, 5:12:37 PM6/19/18
to google-ap...@googlegroups.com
I could see doing this with scheduled tasks and the synchronize command. You might have to time the duration of the command for each OU you're trying to sync, just to be sure one sync is complete before the next one starts, but it's definitely worth exploring.

You could also have a command to export AD users to a .csv file, then have your sync command import that file. . .

______________________________________________________
Andrew Penner, Technical Analyst III (A+, MCP, MCDST)
Office: 780-460-3712 (333)
Mobile:780-913-7576
60 Sir Winston Churchill Ave
St. Albert, AB T8N 0G4




--
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/7ab736d6-d0a8-4995-8136-83fdf6bfb546%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



  Find us on Facebook:
  Follow us on Twitter: 

Ross Scroggs

unread,
Jun 19, 2018, 5:26:57 PM6/19/18
to google-ap...@googlegroups.com
Dennis,

If group A is made up of users from OU A, then you say:
gam update gro...@domain.com sync member ou /PathToOUA
This does adds/removes as necessary to make the membership of group A match the users in OU A.

Ross


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


--
Message has been deleted

Dennis Mattei

unread,
Jun 19, 2018, 9:05:22 PM6/19/18
to GAM for G Suite
Thanks!  Basically im stuck with trying to figure out how to keep a bunch of email lists updated most that wont change often, but things like employee/intern/contractor,  building email groups, departmental groups

Would love to have a user move buildings, update the AD info, sync to google, and somehow have that update email groups.   We will have a way to do this in the near future, but im more interested in "is there an easy way i could make this happen now to save myself the headache untill the new solution"

Setting something up scheduled is probably the only way.   But I havent thought of using CSV from AD and then using gam.

Dennis M

unread,
Jun 19, 2018, 9:07:23 PM6/19/18
to GAM for G Suite
Thanks Ross!

im having trouble printing orgs 

$ gam print orgs name

ERROR: name is not a valid argument for "gam print orgs"

probably a bug report... but im assuming i need to type the path correctly so printing the name was my next step 

+KimNilsson

unread,
Jun 25, 2018, 4:38:21 AM6/25/18
to GAM for G Suite
Just remove the offending option.

gam print orgs

Ross Scroggs

unread,
Jun 25, 2018, 9:16:35 AM6/25/18
to google-ap...@googlegroups.com
Dennis,

<OrgUnitFieldName> ::=
        description|id|inherit|name|orgunitpath|parent|parentid|inherit
<OrgUnitFieldNameList> ::= "<OrgUnitFieldName>(,<OrgUnitFieldName>)*"

gam print orgs|ous [todrive] [toplevelonly] [from_parent <OrgUnitPath>] [allfields|(fields <OrgUnitFieldName>+)]

gam print orgs fields name

Ross

This message contains information which may be confidential and/or protected by attorney-client privilege.  Unless you are the addressee, you may not use, copy or disclose to anyone this message or any information contained in this message.  If you have received this message in error, please send me an email and delete this message.   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-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.

Ross Scroggs

unread,
Jun 25, 2018, 10:34:39 AM6/25/18
to google-ap...@googlegroups.com
Dennis,

Correction: it should be fields <OrgUnitFieldNameList> instead of fields <OrgUnitFieldName>+
<OrgUnitFieldName> ::=
        description|id|inherit|name|orgunitpath|parent|parentid|inherit
<OrgUnitFieldNameList> ::= "<OrgUnitFieldName>(,<OrgUnitFieldName>)*"

gam print orgs|ous [todrive] [toplevelonly] [from_parent <OrgUnitPath>] [allfields|(fields <OrgUnitFieldNameList>)]

gam print orgs fields name

Ross
--

Mark Fratto

unread,
Apr 24, 2019, 3:00:00 PM4/24/19
to GAM for G Suite
Well the fields part is just no longer working 

Ross Scroggs

unread,
Apr 24, 2019, 3:11:30 PM4/24/19
to google-ap...@googlegroups.com
Mark,

What is your Gam version?
Show the command and the error message.

Ross

On Wed, Apr 24, 2019 at 12:00 PM Mark Fratto <mark....@gmail.com> wrote:
Well the fields part is just no longer working 

gam print orgs fields name

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


--

Mark Fratto

unread,
Apr 24, 2019, 3:27:06 PM4/24/19
to GAM for G Suite
GAM version 4.72 latest stable

there is no error message it just prints the same thing with our with out without the fields. The following three commands product the same results

gam print orgs 
gam print orgs fields name
gam print orgs fields name,orgUnitId

by default "orgUnitPath,orgUnitId,name,parentOrgUnitId" is outputted but it need it to only out put only "name,orgUnitId"


I knew I should have built my script application in linux with bash instead of windows batch. Would care of the output as I would use grep cut awk sed etc to manipulate the data. powershell and batch are just not as easy or fast to cut up with.





On Wednesday, April 24, 2019 at 2:11:30 PM UTC-5, Ross Scroggs wrote:
Mark,

What is your Gam version?
Show the command and the error message.

Ross

On Wed, Apr 24, 2019 at 12:00 PM Mark Fratto <mark....@gmail.com> wrote:
Well the fields part is just no longer working 

gam print orgs fields name

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


--
Ross Scroggs

Ross Scroggs

unread,
Apr 24, 2019, 4:11:00 PM4/24/19
to google-ap...@googlegroups.com
Mark,

In standard GAM (4.72), you always get: 'orgUnitPath', 'name', 'orgUnitId', 'parentOrgUnitId'.
The fields argument just lets you add optional fields, e.g., description.

In Advanced GAM( https://github.com/taers232c/GAMADV-XTD) you can select just the fields you want.

Ross

On Wed, Apr 24, 2019 at 12:27 PM Mark Fratto <mark....@gmail.com> wrote:
GAM version 4.72 latest stable

there is no error message it just prints the same thing with our with out without the fields. The following three commands product the same results

gam print orgs 
gam print orgs fields name
gam print orgs fields name,orgUnitId

by default "orgUnitPath,orgUnitId,name,parentOrgUnitId" is outputted but it need it to only out put only "name,orgUnitId"


I knew I should have built my script application in linux with bash instead of windows batch. Would care of the output as I would use grep cut awk sed etc to manipulate the data. powershell and batch are just not as easy or fast to cut up with.





On Wednesday, April 24, 2019 at 2:11:30 PM UTC-5, Ross Scroggs wrote:
Mark,

What is your Gam version?
Show the command and the error message.

Ross

On Wed, Apr 24, 2019 at 12:00 PM Mark Fratto <mark....@gmail.com> wrote:
Well the fields part is just no longer working 

gam print orgs fields name

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


--
Ross Scroggs

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


--

Mark Fratto

unread,
Apr 24, 2019, 4:26:43 PM4/24/19
to GAM for G Suite
Awesome, thanks a ton


On Wednesday, April 24, 2019 at 3:11:00 PM UTC-5, Ross Scroggs wrote:
Mark,

In standard GAM (4.72), you always get: 'orgUnitPath', 'name', 'orgUnitId', 'parentOrgUnitId'.
The fields argument just lets you add optional fields, e.g., description.

In Advanced GAM( https://github.com/taers232c/GAMADV-XTD) you can select just the fields you want.

Ross

On Wed, Apr 24, 2019 at 12:27 PM Mark Fratto <mark....@gmail.com> wrote:
GAM version 4.72 latest stable

there is no error message it just prints the same thing with our with out without the fields. The following three commands product the same results

gam print orgs 
gam print orgs fields name
gam print orgs fields name,orgUnitId

by default "orgUnitPath,orgUnitId,name,parentOrgUnitId" is outputted but it need it to only out put only "name,orgUnitId"


I knew I should have built my script application in linux with bash instead of windows batch. Would care of the output as I would use grep cut awk sed etc to manipulate the data. powershell and batch are just not as easy or fast to cut up with.





On Wednesday, April 24, 2019 at 2:11:30 PM UTC-5, Ross Scroggs wrote:
Mark,

What is your Gam version?
Show the command and the error message.

Ross

On Wed, Apr 24, 2019 at 12:00 PM Mark Fratto <mark....@gmail.com> wrote:
Well the fields part is just no longer working 

gam print orgs fields name

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


--
Ross Scroggs

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


--
Ross Scroggs

Jay Lee

unread,
Apr 24, 2019, 4:28:20 PM4/24/19
to google-ap...@googlegroups.com
GAM 4.81 landing shortly will also add ability to filter rows and columns locally to the same effect.

Jay

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


--
Ross Scroggs

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


--
Ross Scroggs

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