GAM add CSV of users to group

1,955 views
Skip to first unread message

Eric Lind

unread,
Sep 17, 2019, 9:23:11 AM9/17/19
to GAM for G Suite

I am trying to add users to a group based on a CSV file. I am running the command gam csv faculty1.csv gam update group 2019 add user ~Email 

It runs and returns the whole list of users from facutly1.csv, but each line has the following error " Add as MEMBER Failed: Invalid Input: memberKey

I am sure I am missing something simple here....I am a new GAM users, so still learning the ins and outs. 

Thanks,
Eric 



Kevin Melillo ✉

unread,
Sep 17, 2019, 9:28:50 AM9/17/19
to google-ap...@googlegroups.com
CSV File Format:
Email

GAM Command:
gam csv faculty1.csv gam update group 20...@domain.com add member user ~Email

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/2e8a07d5-4f56-4bc8-b5b7-00f00bb51dea%40googlegroups.com.


--
photo
Kevin Melillo
Electronic Communications Analyst, Information Technology

Phone: 732.465.6609 | Mobile: 732-609-4331

Email: k.me...@ieee.org

445 Hoes Lane Piscataway, NJ 08854

Eric Lind

unread,
Sep 17, 2019, 9:34:26 AM9/17/19
to GAM for G Suite
Kevin- I tried that just now, and still returning same error. 

Eric 

Ian Bevan

unread,
Sep 17, 2019, 9:53:23 AM9/17/19
to GAM for G Suite
Trying changing the column header to something else.
I had similar earlier this week but as soon as I changed the ~Email to ~userEmail it worked.

Eric Lind

unread,
Sep 17, 2019, 10:02:29 AM9/17/19
to GAM for G Suite
Thanks, Ian. I tried your suggestion, but still getting same error. 

Kevin Melillo ✉

unread,
Sep 17, 2019, 3:51:03 PM9/17/19
to google-ap...@googlegroups.com
Can you try the following command with just 1 user?

gam update group 20...@domain.com add member user us...@domain.com

See if it is giving an error. 

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

Kevin Melillo ✉

unread,
Sep 17, 2019, 3:52:12 PM9/17/19
to google-ap...@googlegroups.com
Quick question as well:  Are you doing this in PowerShell or Bash?  

Ross Scroggs

unread,
Sep 17, 2019, 4:00:40 PM9/17/19
to google-ap...@googlegroups.com
Kevin,

Eric's file looked like this (what you can't see is the trailing blank at the end of the user lines.
Email
usera
userb
...

He has GA_DOMAIN set to his domain.
gam reads the file, sees that there is no domain on the addresses and adds it on producing "usera @domain.com", "userb @domain.com"

We stripped the blanks and all is well.

Ross



--

Kevin Melillo ✉

unread,
Sep 17, 2019, 4:04:13 PM9/17/19
to google-ap...@googlegroups.com
Wow.  Good catch.  Glad you got that resolved.

Eric Lind

unread,
Sep 17, 2019, 4:10:11 PM9/17/19
to GAM for G Suite
Thanks again, Ross! Much appreciated! Glad it was something simple- I will check for that next time! The file I originally used to create the list of faculty users had an extra word at the front end of each users email- I did a find and replace in Excel to remove the words from each line, leaving just the email, but overlooked the fact that I would also need to add the space into my find and replace in order to delete the space out.

Per Ross suggestion- opened the csv file in notepad, which revelaed the extra spaces! 

Glad it's fixed. Lesson learned! 
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.


--
photo
Kevin Melillo
Electronic Communications Analyst, Information Technology

Phone: 732.465.6609 | Mobile: 732-609-4331

Email: k.me...@ieee.org

445 Hoes Lane Piscataway, NJ 08854

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

Eric Lind

unread,
Sep 17, 2019, 4:10:58 PM9/17/19
to GAM for G Suite
Thanks for your help and suggestions, Kevin! 


On Tuesday, September 17, 2019 at 3:04:13 PM UTC-5, k.melillo wrote:
Wow.  Good catch.  Glad you got that resolved.

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


--
photo
Kevin Melillo
Electronic Communications Analyst, Information Technology

Phone: 732.465.6609 | Mobile: 732-609-4331

Email: k.me...@ieee.org

445 Hoes Lane Piscataway, NJ 08854

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