GAM scripting for GSuite Admin Tools ??

92 views
Skip to first unread message

David Fawcett

unread,
Aug 24, 2018, 2:41:13 PM8/24/18
to techc...@list.em.ohio.gov, appsus...@googlegroups.com
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
EFudd,Elmer,Fudd,WabbitSeason
YSam,Yosemite,Sam,IHateYouRabbit
TBird1,Tweety,Bird,PuttyTat

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

Thanks
--
Sent from Elmwood Local Schools 

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

Dana Lehman

unread,
Aug 24, 2018, 2:55:26 PM8/24/18
to appsus...@googlegroups.com, 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\
c:\gam\gamstaffcmd.cmd



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 appsusergroup+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Dana Lehman
System Administrator
Highland Local Schools


Reply all
Reply to author
Forward
0 new messages