Group update - strange beahaviour

500 views
Skip to first unread message

Samuel

unread,
Jun 6, 2017, 2:24:17 AM6/6/17
to GAM for G Suite
Hello,

I have a strange beahviour when updating my groups and it's random

I run these two commands successively
gam update group myl...@mydomain.com add member user myu...@mydomain.com
Result : ERROR: 409: Member already exists. - duplicate

gam update group myl...@mydomain.com update owner myu...@mydomain.com
Result : ERROR: 404: Resource Not Found: memberKey - notFound

Frist my user is duplicate and after he's not found

Any clue ?

GAM 4.22 - https://git.io/gam
Jay Lee <jay0lee@...>
Python 2.7.9 32-bit final
google-api-python-client 1.6.2
Linux-3.16.0-4-686-pae-i686-with-debian-8.6 i686

+KimNilsson

unread,
Jun 6, 2017, 5:46:14 AM6/6/17
to GAM for G Suite
What happens if you only do.

gam update group myl...@mydomain.com add member myu...@mydomain.com

Graham Ingleby

unread,
Jun 6, 2017, 7:38:05 AM6/6/17
to GAM group
You are adding a MEMBER and then updating OWNER, try updating MEMBER




This message is for the named person's use only. If you receive this message in error, please delete it and notify the sender. Ancoris reserves the right to monitor all e-mail communications through its networks. Ancoris Limited, Registered in England Number: 04830784, Registered address: 5a Frascati Way, Maidenhead, Berkshire SL6 4UY. Trading Address: Lily Hill House, Lily Hill Road, Bracknell, Berkshire RG12 2SJ




Ross Scroggs

unread,
Jun 6, 2017, 9:55:09 AM6/6/17
to google-ap...@googlegroups.com
Samuel,

What does this show for myuser: gam print group-members group myl...@mydomain.com

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/CAAcgOW7rMXBok_9qv8Bu3u_Ud7Wg6UHosw2CCvE-tG-tRwMMHQ%40mail.gmail.com.

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



--

Samuel

unread,
Jun 7, 2017, 3:10:05 AM6/7/17
to GAM for G Suite
@Kim
What happens if you only do.
gam update group myl...@mydomain.com add member myu...@mydomain.com

The user is added

@Graham

You are adding a MEMBER and then updating OWNER, try updating MEMBER

At wich step should I update the member ?

@Ross

What does this show for myuser: gam print group-members group myl...@mydomain.com

The user is missing


What is strange is that I do that for 40 groups, and it fails for 1 or 2 and never the same groups

I already put sometging like this, to check what happens but without result
gam print group-members group mylist@mydomain.com | grep myuser@mydomain
gam update
group mylist@mydomain.com add member myuser@mydomain.com
gam
print group-members group mylist@mydomain.com | grep myuser@mydomain
gam update
group mylist@mydomain.com update owner myuser@mydomain.com
gam
print group-members group mylist@mydomain.com | grep myuser@mydomain

Today all is ok, I'll try again tomorrow

Ross Scroggs

unread,
Jun 7, 2017, 7:26:13 AM6/7/17
to google-ap...@googlegroups.com
Samuel,

Your update command is correct, however you can add an owner/manager in a single step.

gam update group <GroupItem> add [member|manager|owner] [notsuspended] <UserTypeEntity>

 
Is the source of the data such that you don't know if myuser is already in the group; that the goal is to make them an owner whatever the current situation is?

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.

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



--

Samuel

unread,
Jun 13, 2017, 2:52:38 AM6/13/17
to GAM for G Suite
I changed my process

before :
1st step check if user is in list, if not add user
2nd step check if user is in list, if yes update owner
the 2 checks are run one after ther others, so if someone is added in step 1 he will be updated in step 2

now :
if user is in list, if not add owner
or
if user is in list, if yest update owner
only one command is exectued

it seems to be working now

Stalin Bustamante

unread,
Jun 23, 2017, 1:22:45 PM6/23/17
to GAM for G Suite
Hi, 

In my organization we have G-Suites for Education, I have installed GAM to manage work related to accounts and groups.

When trying to add or remove it shows me this message.

"ERROR: 403: Insufficient Permission - InsufficientPermission

I have successfully completed the GAM installation process and created the service account with the necessary permissions to manage my domain resources.
What could be happening

Thanks.

Ross Scroggs

unread,
Jun 23, 2017, 2:29:20 PM6/23/17
to google-ap...@googlegroups.com
Stalin,

What command are youtrying to execute?

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

Stalin Bustamante

unread,
Jun 23, 2017, 3:20:44 PM6/23/17
to GAM for G Suite


This command:

gam update group <email-group@mydomain> add user <emailuser@mydomain>

and this other:

gam update group <email-group@mydomain> remove user <emailuser@mydomain>



El viernes, 23 de junio de 2017, 14:29:20 (UTC-4), Ross Scroggs escribió:
Stalin,

What command are youtrying to execute?

Ross
--




On Jun 23, 2017, at 10:13 AM, Stalin Bustamante <stalin.b...@gmail.com> wrote:

Hi, 

In my organization we have G-Suites for Education, I have installed GAM to manage work related to accounts and groups.

When trying to add or remove it shows me this message.

"ERROR: 403: Insufficient Permission - InsufficientPermission

I have successfully completed the GAM installation process and created the service account with the necessary permissions to manage my domain resources.
What could be happening

Thanks.

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

unread,
Jun 23, 2017, 3:37:19 PM6/23/17
to google-ap...@googlegroups.com
Stalin,

Do this: gam oauth info

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.

Stalin Bustamante

unread,
Jun 23, 2017, 4:20:52 PM6/23/17
to GAM for G Suite
Ross, 

I applied the command indicated and got the following result 

"scopes": [
        "email",
    ],

I guess the bottom line is why I can not add or remove members to groups ?:

Regards.


El viernes, 23 de junio de 2017, 15:37:19 (UTC-4), Ross Scroggs escribió:
Stalin,

Do this: gam oauth info

Ross
--




Ross Scroggs

unread,
Jun 23, 2017, 8:25:26 PM6/23/17
to google-ap...@googlegroups.com
Stalin,

Here are the default scopes for Gam 4.22:
Scopes (27):

What version are you running?
You can change your scopes with:
Rename oauth2.txt to oauth2.sav to keep a backup
gam oauth create

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.

Stalin Bustamante

unread,
Jun 27, 2017, 6:38:39 PM6/27/17
to GAM for G Suite
Hi Ross,

I have GAM version 4.22 installed.
Run the "gam oauth create" command to redefine the accesses of the authorized admin account and view the list of api's that I can use, 

Select the authorized scopes by entering a number.
Append an 'r' to grant read-only access or an 'a' to grant action-only access.

[*]  0)  Classroom API - counts as 5 scopes
[*]  1)  Cloud Print API
[*]  2)  Data Transfer API (supports readonly)
[*]  3)  Directory API - Chrome OS Devices (supports readonly)
[*]  4)  Directory API - Customers (supports readonly)
[*]  5)  Directory API - Domains (supports readonly)
[*]  6)  Directory API - Groups (supports readonly)
[*]  7)  Directory API - Mobile Devices (supports readonly and action)
[*]  8)  Directory API - Notifications
[*]  9)  Directory API - Organizational Units (supports readonly)
[*] 10)  Directory API - Resource Calendars (supports readonly)
[*] 11)  Directory API - Roles (supports readonly)
[*] 12)  Directory API - User Schemas (supports readonly)
[*] 13)  Directory API - User Security
[*] 14)  Directory API - Users (supports readonly)
[*] 15)  Email Settings API - Delegation
[*] 16)  Group Settings API
[*] 17)  License Manager API
[*] 18)  Reports API - Audit Reports
[*] 19)  Reports API - Usage Reports
[ ] 20)  Reseller API
[*] 21)  Site Verification API


     s)  Select all scopes
     u)  Unselect all scopes
     e)  Exit without changes
     c)  Continue to authorization
Please enter 0-21[a|r] or s|u|e|c:

After completing the indicated steps GAM was authorized to execute admin actions.
Then probe the command gam update group <group-name> remove user <user @ mydomain> and you can execute it successfully.

Thank you very much for your help.


Reply all
Reply to author
Forward
0 new messages