Skip to content

Commit

Permalink
deprovisioning and mobile devices added
Browse files Browse the repository at this point in the history
  • Loading branch information
larsen161 committed Aug 16, 2018
1 parent b68651a commit 26591e0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions offboard.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash
# Set the path to the GAM you want to use
GAM=/home/s_larsen/bin/gamadv-xtd/gam
GAMFILEPATH=~/gam-data

# Capture the leavers email address
get_leaver () {
Expand All @@ -18,17 +19,24 @@ read -r manager

# Remove the user form the google address list (contacts)
remove_gal () {
# removes the user from the google address list
$GAM update user ${leaver} gal off
}

# Remove the user from all groups they are a member of, saving a list in case
remove_groups () {
# removes the user from all groups they are a member of
$GAM print user ${leaver} groups > ${leaver}_group_membership.csv
$GAM user ${leaver} delete groups
}

# Revoked all App Passwords, 2 Factor, and OAuth tokens
# Wipe Account from All Mobile Devices
deprovision () {
$GAM user ${leaver} deprovision
$GAM print mobile query "email:${leaver}" >> $GAMFILEPATH/tmp.mobile-data.csv
$GAM csv $GAMFILEPATH/tmp.mobile-data.csv gam update mobile ~resourceId action account_wipe
rm $GAMFILEPATH/tmp.mobile-data.csv
}

# Set the vacaction messaage
set_ooo () {
$GAM user ${leaver} vacation on subject "Left the Company" message "I have now left the Company. Please contact for all queries.\nn\nThank You"
Expand Down Expand Up @@ -72,6 +80,8 @@ do
if [[ $newManager = "" ]]; then
newManager="$manager"
fi

echo "Please log into Admin Console and reset sign in cookies for ${leaver}"

break
;;
Expand Down

0 comments on commit 26591e0

Please sign in to comment.