In this blog post, we will learn how to auto-delete suspended Google Workspace users for 6 months. In an OU, the IT admin may need to suspend a user for 6 months. Also, they might want to automatically delete inactive users from Google Workspace. As an IT Admin, you are required to suspend inactive user accounts or the ones who have left your organization permanently. Then automatically deleting the suspended user accounts after a particular period, like 6 months is important as -

  • It will free up their Google accounts’ license cost. Otherwise, the suspended user needs to pay a license cost similar to one active user. Read this helpful support doc.
  • Also, it will help to protect your organizational data from any kind of hacking activity. Because, a suspended user account remains idle for a long time, is open to hackers and other security issues.

Thus we need to perform this task, and with Foresight you can do it in a few easy steps. In this article, you will learn how to automatically delete a suspender user for 6 months through Foresight. Let’s see how it will happen.

How to auto-delete Google Workspace users who have been suspended for 6 months with Foresight?

Foresight is an automation tool that helps you to perform missing features of the Google Admin console through Google Workspace Admin and user use cases. But you don’t need to worry about coding knowledge because it’s a no-code SaaS platform. It saves your time through automated tasks and increases business productivity by removing repetitive day-to-day IT admin tasks. 

If we talk about the Google Admin Console, this feature is not present within it. Thus Foresight implemented this feature to help the Google Admin. Also, this is an edge of Foresight over Admin Console. The goal of this video is to create an automation rule for users who have been suspended for 6 months and automatically delete them.

Instructions

You will perform this task by creating two rules –

Rule 1 - Auto creates user suspension events: To create an automation rule to create an event for the Google Workspace users who have been suspended for 6 months and automatically delete them.

Rule 2 - Auto deletes users by calendar event: it will only automate Rule 1.

Demo Video

From this video, we will learn about how to auto-delete Google Workspace users who have been suspended for 6 months with Foresight.

Rule Creation

Rule 1 - Auto creates user suspension events:

  1. Sign in to the Foresight account with the help of a Google Admin account. Go to the Rules page and click the New Rule New rule button button.Bulk update employees information in Google Workspace
  2. Select the User Suspended trigger.Google Workspace
  3. After that, ensure Foresight gets access permission from Google Workspace Account. Once the permission is granted you can see the Access granted status. Click Next.Google Workspace
  4. Select the Create DateTime action from all available actions.Google Workspace
  5. Next, select Current Datetime in Source Datetime and 6 Months in the Time change steps fields. Type User suspension time in the Variable name field.Auto delete 6 months suspended usersGoogle Workspace
  6. Click on Add Next action. Select the Create calendar event action.Google Workspace
  7. Then, select Primary Calendar in Calendar. Type Delete user and curly braces {{ and select User Suspension Time in the Event title field. The variable will look like Delete user {{ UserSuspensionTime }}. Also, select User Suspension Time in Start time. You can skip the rest of the fields. Click Review.Google WorkspaceGoogle Workspace
  8. Enter the Rule name (Rule 1- Auto create user suspension events) and click Create.Google Workspace You can see that Rule 1 has been created on the Rules page.Google Workspace

Rule 2 - Auto deletes users by calendar event:

  1. Now create Rule 2. So, click on the New Rule button.
  2. Select the Calendar event started to trigger.Google Workspace
  3. Select Primary Calendar in Calendars. Type Delete user in the Event title. Click Next.Google Workspace
  4. Next, select the Get Calendar event info action from all available actions.Google Workspace
  5. Select Primary Calendar in Calendar and Calendar Event ID in the Event field.Google Workspace
  6. Click Add Next action. Select the Extract data from text action.Google Workspace
  7. Select Event Title in the Source text and EMAIL in the Data type to extract the field. Type User Email in the Variable name.Google Workspace
  8. Again, click Add Next action. Select the Delete user action.Google Workspace
  9. Select User Email in Primary email. Click Review.Google Workspace
  10. Enter the Rule name (Rule-2 Auto delete users by calendar event) and click Create. Google WorkspaceYou can see that Rule 2 has been created on the Rules page.Google Workspace

Triggering The Rule

1.      Now you have to trigger the rule from the Admin Console. You have to suspend a user. To suspend a user you have to go to Users > Mouseover on any Username > More options > Suspend user > Suspend.Google WorkspaceGoogle Workspace

Verifying Results.

1.      Then, you will get a notification about the user-suspended event creation. From the Logs page you will find the notification that the user was suspended. Again, you will find a date-time for the Calendar event scheduled 6 months later to automatically delete the suspended user. So, the user will be deleted on that date, say 15th November 2023.Google Workspace

2.      Also, you can verify the result from Google Calendar. As you can see, a Calendar is scheduled for the future, which will start exactly 6 months after any user is suspended. And when this event will start, Rule 2 will be triggered automatically and delete the suspended user.Google Workspace

Conclusion

So, you have learned how to auto-delete Google Workspace users who have been suspended for 6 months with Foresight. It will send the notification whenever a user will be suspended on Admin Console. Then automatically delete the suspended user after 6 months. You can create the two rules for this automated task without wasting too much time. Thus it increases productivity. So, explore Foresight and try 14-days free trial to know more. You can learn related topics like - How To Bulk Suspend Users in Google Workspace, Suspend a user temporarily, etc