Downloading GAM 

https://github.com/jay0lee/GAM/wiki#download-gam 


Configure GAM 

https://github.com/jay0lee/GAM/wiki#creating-a-project 


Running GAM for the First Time


On Windows, you can do this by going to Start -> Programs -> Accessories -> Command Prompt. > Location of GAM

Now run:  gam info user


You'll be asked to specify which "scopes" you'd like the OAuth token to support. For now, select the last option to continue, all scopes will be selected. Next GAM will open up a web page in order for you to grant access to retrieve data and make changes to your G Suite account. Make sure you are logged in to a Google G Suite Administrator account before granting access. Once you've granted access, switch back to the command prompt window, GAM should already be working to display information about your user account.  


Try to create the user by creating the user as per the below command

gam create user crashtestdummy firstname Crash lastname "Test Dummy" password "BuckleUp"


If you are getting an error like Client is not authorised Kindly browse where the GAM is installed and check whether you are able to get client_secret and oauth2service.Open the oauth2service and find the client ID copy the clientID and Open the Gsuite admin console and browse the URL:https://admin.google.com/ac/owl/domainwidedelegation?hl=en  Click on Add and paste the Client ID and paste the below API 

https://mail.google.com/,
https://sites.google.com/feeds,
https://www.google.com/m8/feeds,
https://www.googleapis.com/auth/activity,
https://www.googleapis.com/auth/calendar,
https://www.googleapis.com/auth/drive,
https://www.googleapis.com/auth/gmail.settings.basic,
https://www.googleapis.com/auth/gmail.settings.sharing,
https://www.googleapis.com/auth/plus.login,
https://www.googleapis.com/auth/plus.me,
https://www.googleapis.com/auth/userinfo.email,
https://www.googleapis.com/auth/userinfo.profile,

Now again try to run the command and check if you are able to create the user.If you are able to create the user then the GAM is correctly configured.

gam create user crashtestdummy firstname Crash lastname "Test Dummy" password "BuckleUp"

For your practice use the commands as per the link the link https://github.com/jay0lee/GAM/wiki/GAM3DirectoryCommands 


I have run some GAM commands for some customer and below are the snapshots.

Note:Whenever you are using the GAM commands to delete an mail from user mailbox by default only 1 mail is deleted.In order to delete all the email you need to specify keyword doit and max <value> this will delete the mail as per the max value set.



To perform bulk operation Refer the commands as per the article link https://github.com/jay0lee/GAM/wiki/BulkOperations