[GAM] - Error 400 Bad Request when deleting users from a group

539 views
Skip to first unread message

MARCOS DÍEZ

unread,
Aug 28, 2013, 5:50:49 AM8/28/13
to google-ap...@googlegroups.com
I've made a powershell script to empty 12 groups with emails written in a CSV file. I've used a sentence like this: 

gam update group fami...@school.cat remove group fami...@school.cat

When execute I receive the message "Error 400: Bad Request - badRequest" for many emails.

I've discovered that only domain accounts, external gmail (and a little amount of other) accounts have been deleted.

When I manually try to delete an email from yahoo.com or hotmail.com (and other domains) I receive the same error. In this case I've used this:

gam update group fami...@school.cat remove <user>@hotmail.com

I am working with GAM 3.0 in Windows 7 64bit.

Thanks.

Jay Lee

unread,
Aug 28, 2013, 9:11:09 AM8/28/13
to google-ap...@googlegroups.com
Hi Marcos,

  I've been able to reproduce the issue myself. It looks like a problem with Google's servers. I've filed a ticket with Google support and will keep you updated.


Regards,

Jay Lee
Large Customer Deployment Lead   |  Dito


--
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/4572774b-fcab-4ee9-a030-5c37826da02c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Mike Herman

unread,
Sep 10, 2013, 12:00:12 PM9/10/13
to google-ap...@googlegroups.com
I am also experiencing this issue.

Mike Herman

unread,
Oct 11, 2013, 3:01:47 PM10/11/13
to google-ap...@googlegroups.com
I have been in contact with Google about this, they have not been helpful. For your reference see the exchange below. I'm not a programmer, so I wasn't able to follow the instructions he gave (I can't get powershell to authenticate with google's API without using GAM). Maybe someone with more experience can try what he suggests:

Case: #03459140
Subject: Error 400: Bad Request - badRequest

When using GAM to manage members of a group, if I attempt to delete a non-google mail email address I get the above error (Error 400: Bad Request - badRequest).

The same issue is reported here https://groups.google.com/forum/#!topic/google-apps-manager/XNQnsurAUk4

And at stackoverflow here stackoverflow.com/questions/18492861/directory-api-delete-member-api-operation-fails-for-non-google-accounts

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

Hello Mike,

Thanks for your message.

As you are reporting that this issue is still persisting for you, I went and tried it myself. I was not able to reproduce your results. Here are the steps which I took:

1. Created a group called groupa...@testdomain.com and added my own admin account and a personal Gmail account.
2. Authenticated with OAuth Playground 2.0 using API Console project with Admin SDK.
3. Used the scope - https://www.googleapis.com/auth/admin.directory.group - associated with Admin SDK > Directory API.
4. Exchanged for token. HTTP 1/1 200 Successful.
5. GET https://www.googleapis.com/admin/directory/v1/groups/groupa...@testdomain.com/members/x...@gmail.com
6. HTTP 1/1 200 Successful.
7. DELETE https://www.googleapis.com/admin/directory/v1/groups/groupa...@testdomain.com/members/x...@gmail.com
8. HTTP 1/1 204 No content.

One thing which I noticed from your last message is that your request is suffixed by the following: ''?quotaUser=
fc608ed99d7b5c79b3cf35ec87ea8c36b2451995&prettyPrint=true'' , For reference, I believe that your request should look like this: DELETE /admin/directory/v1/groups/testgro...@cictr.com/members/x...@mail.com HTTP/1.1.

In conclusion, the Directory API is functioning correctly and is able to remove non Google Apps email addresses from groups. You can confirm this for your self by following the steps which I outlined above. It seems that these extra line is being added by the GAM tool. In this instance in order to receive support on the GAM tool, I recommend getting in touch with GAM's developers directly through their product forum available to you here: http://goo.gl/LocpH.

I hope that you found the above information useful. Please do not hesitate to contact the Enterprise Support team in the future should you need to do so. Thanks for using Google Apps.

Have a great day.

Sincerely,

John
Google Enterprise Support

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

Hi John,

It appears from what you sent me that you tried this using a personal Gmail account, not a non-gmail account. I have no problems removing any email that is hosted at gmail, either on a google business domain or a personal @gmail.com account. What I can't do is remove a user who is on a different email system (ie, not hosted at google).

When I try to remove an account at mail.com (not Gmail.com, just Mail.com) I get the bad request error.

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

Hi Mike,

Thanks for the update.

I have now tested this using an external address and can confirm that I  was able to replicate the behaviour as you have reported. I have gotten in touch with the relevant team and will get back to you on Monday with their response

Thank you for your continued patience and understanding.

Have a great weekend.

Sincerely,

John,
Google Enterprise Support.

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

Hello Mike,

My apologies but it seems that my last message was sent a little too hastily.

I followed the steps which I provided you with recently once more, this time using a @hotmail.com account, and I was able to successfully remove the hotmail address from my test group. Please try and duplicate this behaviour using the steps I provided and an API project at https://code.google.com/apis/console/

Mike Herman

unread,
Nov 6, 2013, 12:37:06 PM11/6/13
to google-ap...@googlegroups.com
FYI- this has been fixed.
Reply all
Reply to author
Forward
0 new messages