date of the suspension

1,430 views
Skip to first unread message

Nostromo

unread,
Jun 6, 2018, 3:54:03 PM6/6/18
to GAM for G Suite
Dear, is there any way to list the suspended accounts with the date of the suspension?

Ross Scroggs

unread,
Jun 6, 2018, 3:59:23 PM6/6/18
to google-ap...@googlegroups.com
Nostromo,

I don't see a suspension date available in the APIs, so Gam can't help you.

Ross

On Wed, Jun 6, 2018 at 12:54 PM Nostromo <aala...@inia.cl> wrote:
Dear, is there any way to list the suspended accounts with the date of the suspension?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/85e7ed7f-a709-4817-93c2-e52c5bc6eec2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--

Nostromo

unread,
Jun 6, 2018, 4:08:02 PM6/6/18
to GAM for G Suite
OK, and where can you see those API parameters?


El miércoles, 6 de junio de 2018, 15:59:23 (UTC-4), Ross Scroggs escribió:
Nostromo,

I don't see a suspension date available in the APIs, so Gam can't help you.

Ross

On Wed, Jun 6, 2018 at 12:54 PM Nostromo <aala...@inia.cl> wrote:
Dear, is there any way to list the suspended accounts with the date of the suspension?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-manager+unsub...@googlegroups.com.


--

Ross Scroggs

unread,
Jun 6, 2018, 4:10:01 PM6/6/18
to google-ap...@googlegroups.com

On Wed, Jun 6, 2018 at 1:08 PM Nostromo <aala...@inia.cl> wrote:
OK, and where can you see those API parameters?

El miércoles, 6 de junio de 2018, 15:59:23 (UTC-4), Ross Scroggs escribió:
Nostromo,

I don't see a suspension date available in the APIs, so Gam can't help you.

Ross

On Wed, Jun 6, 2018 at 12:54 PM Nostromo <aala...@inia.cl> wrote:
Dear, is there any way to list the suspended accounts with the date of the suspension?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.


--

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.

To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.


--

+KimNilsson

unread,
Jun 7, 2018, 5:23:58 AM6/7/18
to GAM for G Suite
It has been suggested, and I actually think Kevin Melillo does it, that on suspension rename the user with the suspension date.
That way, when you list suspended users, you will have the suspension date available.

✉ Kevin Melillo

unread,
Jun 7, 2018, 8:22:14 AM6/7/18
to google-ap...@googlegroups.com
When we off board users, we do this.  We rename the user to <user>@domain.com to <user>_departed...@domain.com.  We keep accounts active, and delegated to managers for 3 months.  Once this 3 month period is up, we suspend the account fully.  This also has the benefit of knowing when a user left the company, if that is needed.

On Thu, Jun 7, 2018 at 5:24 AM +KimNilsson <there.is.no...@gmail.com> wrote:
It has been suggested, and I actually think Kevin Melillo does it, that on suspension rename the user with the suspension date.
That way, when you list suspended users, you will have the suspension date available.

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

For more options, visit https://groups.google.com/d/optout.


--
Kevin Melillo
Electronic Communications Analyst
Information Technology
445 Hoes Lane
Piscataway, NJ 08854

Phone:732-465-6609 | Mobile: 732-609-4331

Kim Nilsson

unread,
Jun 7, 2018, 9:11:16 AM6/7/18
to Google Apps Manager
Thanks, Kevin.
Seems my memory served me right this time.
/Kim
--
There is No Substitute!

Andrew Penner

unread,
Jun 7, 2018, 10:48:40 AM6/7/18
to google-ap...@googlegroups.com
That's a great idea.
Thanks!

______________________________________________________
Andrew Penner, Technical Analyst III (A+, MCP, MCDST)
Office: 780-460-3712 (333)
Mobile:780-913-7576
60 Sir Winston Churchill Ave
St. Albert, AB T8N 0G4





For more options, visit https://groups.google.com/d/optout.



  Find us on Facebook:
  Follow us on Twitter: 

Alpay Akyol

unread,
Jun 8, 2018, 3:27:44 AM6/8/18
to google-ap...@googlegroups.com
Hi Kevin,

How you handle this renaming process, manually or automated ?

Kim Nilsson

unread,
Jun 8, 2018, 4:50:06 AM6/8/18
to Google Apps Manager
With GAM, of course! :-)

Alpay Akyol

unread,
Jun 8, 2018, 4:53:11 AM6/8/18
to google-ap...@googlegroups.com
I had asked manually or automated, if automated can you tell us how did you perform ?

--
You received this message because you are subscribed to the Google Groups "GAM for G Suite" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To post to this group, send email to google-ap...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-apps-manager.

k.melillo

unread,
Jun 11, 2018, 9:52:02 AM6/11/18
to GAM for G Suite
I have a csv file. It takes email address, first name, last name, manager email, and manager phone...  all comma separated.. 

When we get a new termination, I fill it in for the termination.

I then use a bash script to read the contents of the file, and perform the needed GAM commands. 
See the following, hopefully it is formatted enough to read.  I am using PasteBin for this.

  1. #!/bin/bash
  2. INPUT=~/gam-data/userterm.csv
  3. OLDIFS=$IFS
  4. IFS=,
  5. timestamp=$(date +%Y-%m-%d@%I:%M%p)
  6. [ ! -f $INPUT ] && { echo "$INPUT file not found"exit 99}
  7. while read userEmail userFirst userLast managerEmail managerPhone
  8. do
  9.   domain=${userEmail/*@/ }
  10.   userId=${userEmail/@*/ }
  11.   userId="$(echo -e "${userId}" | sed -e 's/[[:space:]]*$//')"
  12.   domain="$(echo -e "${domain}" | sed -e 's/^[[:space:]]*//')"
  13.   domain="@$domain"
  14.   dateStamp=_departed_$(date +%Y%m%d)
  15.   newEmail=$userId$dateStamp$domain
  16.   if [ -z "$1" ]
  17.   then
  18.     echo -e "\e[91m\e[7mALERT:\e[0m To be used only for termination procedure"
  19.     echo -e "to process changes use \e[91m./termUser doit\e[0m"
  20.     echo -e "---[ \e[93m\e[1mPREVIEW of Changes \e[0m]--- "
  21.     echo -e "\e[1mUnsuspend:             \e[0m$userEmail"
  22.     echo -e "\e[1mRename to:             \e[0m$newEmail"
  23.     echo -e "\e[1mDelegate to:           \e[0m$managerEmail ($managerPhone)"
  24.     echo -e "\e[1mVacation Responder:    \e[0m"
  25.     echo -e "  $userFirst $userLast is no longer with the company, please contact $userFirst's manager at"
  26.     echo -e "  <$managerEmail> or by telephone at $managerPhone.  \n\n  Thank You.  \n  company Support."
  27.     echo -e "\e[36mRemove from All Groups\e[0m"
  28.     echo -e "\e[36mRemove mobile devices\e[0m"
  29.     echo -e "\e[36mMove to ORG /EXEMPT/Departed Staff Hold Normal\e[0m"
  30.     echo -e "---[ \e[93m\e[1mPREVIEW END \e[0m]--"
  31.     echo
  32.   else
  33.     if [ "${1^^}" == "DOIT" ]
  34.     then
  35.       echo -e "---[ \e[93m\e[1mTermination Process for User \e[36m$userFirst $userLast \e[0m]---\e[32m"
  36.       echo -e "\e[36m- Unsuspending User\e[0m"
  37.       echo "* $timestamp * $userEmail - Termination Process Start" >> ~/gam-data/gam-data.log
  38.       ~/bin/gam/gam update user $userEmail suspended off
  39.       echo "* $timestamp * $userEmail - unsuspended" >> ~/gam-data/gam-data.log
  40.       echo -e "\e[36m- Rename User\e[0m"
  41.       ~/bin/gam/gam update user $userEmail username $newEmail
  42.       echo "* $timestamp * $userEmail - renamed to $newEmail" >> ~/gam-data/gam-data.log
  43.       echo -e "\e[36m- Remove from All Groups\e[0m"
  44.       ~/bin/gam/gam user $newEmail delete groups
  45.       echo "* $timestamp * $newEmail - all groups removed" >> ~/gam-data/gam-data.log
  46.       echo -e "\e[36m- Move to Proper ORG\e[0m"
  47.       ~/bin/gam/gam update user $newEmail org "/EXEMPT/Departed Staff Hold Normal"
  48.       echo "* $timestamp * $newEmail - Moved to Departed Staff Hold Normal" >> ~/gam-data/gam-data.log
  49.       echo -e "\e[36m- Delegate access to Manager\e[0m"
  50.       ~/bin/gam/gam user $newEmail delegate to $managerEmail
  51.       echo "* $timestamp * $newEmail - Delegated email to $managerEmail" >> ~/gam-data/gam-data.log
  52.       echo -e "\e[36m- Set Vacation Message\e[0m"
  53.       ~/bin/gam/gam user $newEmail vacation on subject "$userFirst $userLast is no longer with the the company:" message "$userFirst$userLast is no longer with the company, please contact $userFirst's manager by email at <$managerEmail> or by telephone at $managerPhone\n\n Thank You, \n IEEE Support." startdate $(date +%Y-%m-%d) enddate 2099-12-30
  54.       echo "* $timestamp * $newEmail - Set vacation responder to $managerEmail ($managerPhone)" >> ~/gam-data/gam-data.log
  55.       echo -e "\e[36m- Randomize Password for $newEmail\e[0m"
  56.       ~/bin/gam/gam update user $newEmail password random
  57.       echo "* $timestamp * $newEmail - Password Randomized" >> ~/gam-data/gam-data.log
  58.       echo -e "\e[36m- Deprovision $newEmail\e[0m"
  59.       ~/bin/gam/gam user $newEmail deprovision
  60.       echo "* $timestamp * $newEmail - Revoked all App Passwords, 2 Factor, and OAuth tokens" >> ~/gam-data/gam-data.log
  61.       echo -e "\e[36m- Dump Mobile Phones\e[0m"
  62.       ~/bin/gam/gam print mobile query "email:$userEmail" >> ~/gam-data/tmp.mobile-data.csv
  63.       echo -e "\e[36m- Wipe Account from All Mobile Devices\e[0m"
  64.       ~/bin/gam/gam csv ~/gam-data/tmp.mobile-data.csv gam update mobile ~resourceId action account_wipe
  65.       rm ~/gam-data/tmp.mobile-data.csv
  66.       echo "* $timestamp * $newEmail - Mobile Devices Wiped" >> ~/gam-data/gam-data.log
  67.       echo "* $timestamp * $userEmail - Termination Process Complete" >> ~/gam-data/gam-data.log
  68.       echo -e "\e[0m---[ \e[93m\e[1m Termination Process Complete for \e[36m$userFirst $userLast \e[0m]---"
  69.       echo
  70.       echo "Please log into Admin Console and reset sign in cookies for $newEmail"
  71.     fi
  72.   fi
  73. done < $INPUT
  74. IFS=$OLDIFS

Mikhael jabroux

unread,
Jun 23, 2018, 11:36:13 AM6/23/18
to GAM for G Suite
Thanks for Sharing 
You re a life saver!!!
Reply all
Reply to author
Forward
0 new messages