-
Notifications
You must be signed in to change notification settings - Fork 8
/
onboard-gsheet.sh
28 lines (23 loc) · 1.58 KB
/
onboard-gsheet.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
# Set the path to the GAM you want to use
GAM=$HOME/bin/gamadv-xtd3/gam
# Make a copy of this form
# https://docs.google.com/forms/d/1dng2Yud5v0-EAVnrJtEG_VK_1KjGIonLgk5DPtGOCKw/copy
# Then get the sheet ID for the responses to update the ID value below
# There are 3 additional columns that need to be added to the sheet
# These are admin defined values which are used in the commands below
# username = this is the username that makes up the users email. You define it as user or [email protected] depending on your gam and domain setup
# ou = what ou should the user be created in
# onboarding = an email to notify your onboarding team along with the new hire after notify in the first command
# Configure your organisation default and file info
ID=1oIDdFydVgHoDC9saEuf6eH7YSSD8HLDEWe7vIrwcJ3I
TABNAME=pendingHires
OU=Secured/2SVDelayed
# This creates the user, pulling most all the info from the sheet.
# This command has a hard coded value to put users in the [email protected] group
# Update that group value as necessary
$GAM csv gsheet $ADMIN $ID $TABNAME gam create user ~"username" firstname ~"First Name" lastname ~"Last Name" ou ~"ou" relation manager ~"Manager Email" groups member delivery allmail team notify "~~$personalemail~~,~~onboarding~~"
# This command updates the users info which can only be done once the user is created
$GAM csv gsheet $ADMIN $ID $TABNAME gam update user ~"username" phone type mobile value ~"Mobile Phone" primary organization title ~"Job Title" department ~"Primary Team" location ~"Primary Location" primary