GAM scripting for GSuite Admin Tools ??

Skip to first unread message

David Fawcett

Aug 24, 2018, 2:41:13 PM8/24/18
I an trying to use GAM for bulk User Creation.  I have it working for sigle new user add and CSV add after getting syntax corrected.  

Question is how do I create a batch script or Powershell to run based on csv data.

username,firstname,lastname,password for newUser.csv

Example  bbunny,Bugs,Bunny,WhatsUpDoc

Then command cli is gam csv newUser.csv gam create user username ~username firstname ~first name  with changepassword on

Sent from Elmwood Local Schools 

David Fawcett
Network Administrator
Elmwood Local Schools
7650 Jerry City Rd Bloomdale, Ohio 44817

Dana Lehman

Aug 24, 2018, 2:55:26 PM8/24/18
to, techcoords
Where are you getting your csv from?
If you have AD / LDAP I'd recommend using GCDS.  

I've used excel / sheets go just do a fill down with the correct commands and paste in a cmd window.  

GAM also as the ability to run commands with a csv take a look at this documentation.  

Here is a power shell example of mine this is only for one user, but I'm sure you can put it in a foreach with a -append 
$gam = " gam.exe create alias $oldemail user $email" | out-file c:\gam\gamstaffcmd.cmd -Encoding ascii
cd c:\gam\

The variables were populated further up the script.  
Hope those help.  

You received this message because you are subscribed to the Google Groups "Apps User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Dana Lehman
System Administrator
Highland Local Schools

Reply all
Reply to author
0 new messages