Skip to content

duckyafi/Gam-Commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 

Repository files navigation

    GAM COMMANDS


    Domain Level Commands

  • gam info domain (account information about your domain)
  • gam info org testorg (this shows info about an organization, ex. what users are in this certain organization)

  • User Functions

  • gam info user [username] (info about user, groups, login info, etc)
  • gam create alias coolguy user testuser (this command creates an alias named coolguy and appends to the user testuser)
  • gam create user [user.name] firstname "user" lastname "name" password "test405" changepassword on (this creates a new user with a password set and a changepassword set once the user logs on)
  • gam delete user [username] (to delete user)
  • gam undelete user [username] (to undelete user)
  • gam user [username] signout (this signs out the user mentioned in the username section)
  • gam update user [username] suspended on (to suspended user)
  • gam update user [username] suspended off (to unsuspended user)
  • gam update user [username] password newlysetpassword (this command updates user password)
  • gam user [username] show filelist (to show all files users owns)
  • gam user [email protected] update backupcodes (use this command to create backup codes for users)
  • gam update org /example ou add user [email protected] (Use this when you want to move a user to a new org)
  • gam whatis [email protected] (Use this command to determine if address is a Email address, user, alias or group)
  • gam delete alias test.user (This deletes a users alias attached to their account)
  • gam update user [email protected] relation manager [email protected] (Use this command to add relation to user profile)
  • gam update user test.user organization title "IT Support" primary (Use this command if you want to update a users job title)
  • gam update user jschmoe organization title Teacher department Math primary (This updates the job title and the department in one command)
  • gam user test.user show signature (this displays any current signature)
  • gam update user test.user otheremail work test.usersotheremail.com (Use this to add other email to a users G-Suite profile)
  • gam update user test.user otheremail home test.usersotheremail.com (Use this to add other email to a users G-Suite profile)
  • gam user [email protected] show vacation (This command will show users active vacation email settings)
  • gam user [email protected] vacation off (This command turns off users vacation status)
  • gam user [email protected] vacation on subject "Out Of Office" message "Thank you for your email. I am currently out of the office and look forward to responding when I’m back online." startdate 2021-01-01 enddate 2021-01-10 (this command will setup a users vacation response)
  • gam user test.user delete photo (This command will delete a users photos from their profile)
  • gam update user test.user Additional_Details.testfield new (This will update update a custom schema in a users profile)

  • Data Transfer

  • gam user [username] transfer drive [recieving username] (this moves the users files from drive to a new owner)
  • gam print datatransfers (This example prints all data transfers)
  • gam create datatransfer (old owner) [gdrive or calendar] (new owner) (this command is used to transfer users drive data and calendar resources)
  • Examples of using the data transfer command:
    • gam create datatransfer (old owner) gdrive (new owner) privacy_level shared,private (this command just moves the G Drive data)
    • gam create datatransfer (old owner) calendar (new owner) release_resources true (this command just moves the calendar data)


    Google Print

  • gam print printers (this prints a list of all the Google Cloud Printers)
  • gam print printers todrive (this prints the list of all the Google Cloud Printers to a Google Sheet)

  • Calendar Functions

  • gam calendar [username] update owner [username] (this moves calendars resources to a new owner)
  • gam all users print calendars (this command This example lists the calendars for all users)
  • gam calendar [calendaremail] showacl (This shows who can access the calendar and who has permission)
  • gam calendar [calendaremail] add [permission (owner|editor)] [useremail] (This changes permissions on a users calendars)

  • Google Drive Functions

  • gam all users show fileinfo (insert file ID) owners (this command will search the owner of any file in your domain)
  • gam all users show filelist query "fullText contains 'Project Doc'" todrive (Use this command to search the entire domain for a specific document)

  • Email Forwarding

  • gam user test.user add forwardingaddress test.forward (this adds a forwarding address to test.user)
  • gam user test.user forward on [email protected] keep (Use this command when turning on forwarding for a user, this command only works if the user already has a forwarding address added on their account)
  • gam user [email protected] delete forwardingaddress [email protected] (use this to delete a forwarding address)
  • gam user test.user show forwardingaddresses (this shows what forwarding address this user has attached to their account)

  • Email Deletion

  • gam user [username] delete messages query rfc822msgid:[message ID]doit (this command deletes a single email sent to your org)
  • gam all users delete messages query rfc822msgid:[message ID] doit (this command will delete a sent email to the whole org)
  • gam all users delete messages query from:[Email address of the user sending spam] doit (Use this command when trying to delete emails from a specific user)
  • gam user [email protected] delete message query from:[email protected] doit max_to_delete 3 (input any value that you might need)
  • gam user [email protected] delete messages query before:2020-01-01 max_to_delete 1 doit (this will bulk delete messages based on a date)

  • GROUP FUNCTIONS

  • gam create group [group name] (This commands creates a group for you)
  • gam info group [groupname](this displays all the info of that group)
  • gam update group [groupname] add member [username] (add users to a group)
  • gam update group [groupname]update owner user [username] (this changes group ownership to another user)
  • gam user delete groups (this removes user from all google groups)
  • gam print groups todrive (this command will print all the groups in your domain to your personal drive)
  • gam print group-members group_ns example_group todrive (This prints out group members for a specific group)
  • gam print groups name members owners managers delimiter "|" todrive (This prints out all the groups in your domain and prints out each manager, members, and owners to drive)

  • BULK OPERATIONS

  • gam csv [path of csv file] gam delete user ~username (this deletes bulk amount of users using the names on the csv or textfile)
  • gam update org ["directory path"] add user [username] (this moves users to a different ou, make sure to use "/" to specificy which directory)
  • gam print users todrive (this command will push your user list to a google sheet)
  • gam print groups todrive (this command will push your google groups on your domain to a google sheet)
  • gam csv /location/of/csv gam update group [email protected] add members ~username (using the username field in my text editior or csv I can use this command to add a group of people to a particular google group)
  • gam user [email protected] show filelist | gam update user [email protected] password newpassword (using the pipe in between will run the command in order
  • gam batch file-name (using this command you can run multiple GAM commands at one time, each line should contain one GAM command per line)

  • GAMADV-XTD3 Commands


    Google Groups

  • gam print groups member (This will only show direct memebership. It will not show where a User is a memeber of a sub-group)

  • Google Drive

  • gam user (admin email) show filelist fullpath select "google drive ID" tordive (This will show the full file path within a google drive)

  • Google Shared Drive

  • gam user (admin email) update drivefile "file ID" parentid "folder ID on shared drive" (This will move a file from shared drive to a folder located in the the shared drive. Note, you must be in the shard drive to make these changes)
  • gam user (admin email) print filelist select id "folder ID" todrive (This will print out all the files in the shared drive and print them out to your personal drive)

  • ADDITIONAL TOOLS

    Got Your Back (Got Your Back is a command line tool that backs up and restores your Gmail inbox).

    * To install paste the command below:

  • bash <(curl -s -S -L https://git.io/gyb-install)
  • Note: Once Installed paste this command below to test install

  • gyb --email [email protected] --action estimate
  • gyb --email [email protected] --service-account
  • (use this once you enabled the service account option after creating the symlink)

    Note: To run the commands you must in the directory where you installed GYB.

  • bash <(curl -s -S -L https://git.io/gyb-install) -l (use this command to update GYB)

  • How To Upgrade Your Gam Shell

    Note: Paste the command below into your terminal window

  • bash <(curl -s -S -L https://git.io/install-gam) -l

  • How To Set Your Gam Path

    Note: When using GAM by default it doesn't set to your path correctly. You need update your bash_profile (if your using bash, which is default)

  • To do that type: nano .bash_profile then appendend this "export PATH=/usr/local/bin:$PATH"
  • Make sure you are in the correct directory where your GAM folder is located at

About

Google Gam Commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages