Introduction

In this article, you will learn how to automate the deletion of Google Workspace users who have been suspended for 6 months. Managing suspended user accounts can be a tedious task, especially when organizations have a large number of inactive users. Keeping suspended accounts for extended periods may increase security risks, complicate user management, and incur unnecessary user license fees.

Let’s take an example: A company has an internal policy to automatically delete user accounts that have been suspended for 6 months to improve security and keep the system organized. Manually checking and deleting suspended accounts is time-consuming and prone to errors. With the automated user deletion feature in xFanatical Foresight, IT admins can ensure that all users who have been suspended for 6 months or more are automatically removed, saving time and reducing potential security vulnerabilities.

Illustration showcasing how xFanatical Foresight automates the deletion of Google Workspace users suspended for 6 months
Illustration showcasing how xFanatical Foresight automates the deletion of Google Workspace users suspended for 6 months.

Introducing xFanatical Foresight Automation

xFanatical Foresight is a powerful automation platform designed specifically for Google Workspace. It helps administrators efficiently manage and automate the deletion of Google Workspace users who have been suspended for 6 months. With xFanatical Foresight, admins can save time and effort while ensuring that inactive accounts are removed promptly, enhancing security, reducing clutter, and maintaining compliance with organizational policies.

Automation Setup Instructions

In this section, we guide you through the automation setup in xFanatical Foresight. We have 2 ways to set up automation rules, Set up automation from a template and Set up automation from scratch. After completing the automation rule, verify whether the automation meets your requirements.

Set Up Automation From a Template

Set Up Automation From a Template

Supported plans: xFanatical Foresight Elite plan.


The template is designed with two rules to automate and streamline the process of deleting Google Workspace users who have been suspended for 6 months:

  • Rule 1: This rule automatically creates a calendar event in the admin’s Google Calendar, scheduled exactly 6 months after a user is suspended. The event title includes the suspended user’s primary email, and the delay period is configurable based on the organization’s policy.
  • Rule 2: This rule automates the deletion of suspended users once the calendar event from Rule 1 starts. This ensures inactive accounts are efficiently removed, maintaining security and compliance without manual intervention.


Rule 1: Auto create user deletion calendar event

  1. Sign into xFanatical Foresight with your Google Admin account. 
  2. Go to the Templates page.
  3. Search Auto delete users suspended for 6 months and click on it.
    In the Templates  search for Auto delete users suspended for 6 months template in xFanatical Foresight.
  4. In the Templates > Auto delete users suspended for 6 months page, click Copy Rule 1.
    In the Templates  Auto delete users suspended for 6 months page, click the 'Copy rule 1' button to duplicate the automation rule 1 in xFanatical Foresight.
  5. For the first time use of the template rule, an dialog Action needed will display requesting necessary permissions required to copy the rule. Click Connect with Google and authorize the permissions.
  6. Upon authorization, a dialog titled Copy of auto create user deletion calendar event will display.
  7. Click Next.
     
  8. In the Edit actions > Convert datetime screen,
    Configure convert datetime action for auto create user deletion calendar event rule.
    1. In the Time change steps field, set the number of months after which you want to delete users who have been suspended. 
    2. Click Review.
  9. In the Review screen,
    In the Review page, provide rule name and create auto create user deletion calendar event rule.
    1. In Rule name, customize the automation rule name.
    2. Click Create.
  10. The rule is created in the Rules page.
     xFanatical Foresight rule graph automates the creation of user deletion calendar events.
    xFanatical Foresight rule graph for automating the creation of user deletion calendar events in Google Calendar.

Rule 2: Auto delete users suspended for 6 months

  1. In the Templates > Auto delete users suspended for 6 months page, click Copy Rule 2.
    In the Templates data-lazy-srcset= Auto delete users suspended for 6 months page, click the ‘Copy rule 2’ button to duplicate the automation rule 2 in xFanatical Foresight.”>
  2. Click Next. No configuration is required.
  3. Click Review.
  4. In the Review screen,
     In the Review page, provide rule name and create Auto delete users suspended for 6 months rule.
    1. In Rule name, customize the automation rule name.
    2. Click Create.
  5. The rule is created in the Rules page.
     rule graph for automating the deletion of users who have been suspended for 6 months in Google Workspace.
    xFanatical Foresight rule graph for automating the deletion of users who have been suspended for 6 months in Google Workspace.
Set Up Automation From Scratch

Set Up Automation From Scratch

Supported plans: xFanatical Foresight Elite and Professional (Legacy).

Rule 1: Auto create user deletion calendar event

  1. Sign into xFanatical Foresight with your Google Admin account. 
  2. Go to the Rules page, and click new rule button button.
  3. In the Select a trigger screen, select User suspended trigger.
     Select user suspended trigger for auto create user deletion calendar event rule.
  4. Click Next. No configurations required.
  5. In the Select an action screen, select the Convert datetime action.
    Select convert datetime action for auto create 2FA reminder calendar event rule.
  6. In the Edit actions > Convert datetime screen,
    Configure convert datetime action for auto create user deletion calendar event rule
    1. In the Source datetime field, select the Current datetime variable from the dropdown.
    2. In the Time change steps field, set the number of days in advance you want the calendar event to be created.
    3. In the Variable name field, enter the name for the variable.
    4. Click on Add next action.
  7. In the Select an action screen, select the Create calendar event action.
     Select create calendar event action for auto create user deletion calendar event rule.
  8. In the Edit actions > Create calendar event screen,
     Configure create calendar event action for auto create user deletion calendar event rule.
    1. In the Calendar field, select the Primary calendar variable from the dropdown.
    2. In the Event title field, enter the event title according to your requirement.
    3. In the Start time field, select the User deletion time variable from Convert datetime action.
    4. Click Review.
  9. In the Review screen,
    In the Review page, provide rule name and create auto create user deletion calendar event rule.
    1. In Rule name, customize the automation rule name.
    2. Click Create.
  10. The rule is created in the Rules page.
    xFanatical Foresight rule graph automates the creation of user deletion calendar events.
    xFanatical Foresight rule graph for automating the creation of user deletion calendar events in Google Calendar.

Rule 2: Auto delete users suspended for 6 months

Next, configure a second rule to automatically delete the users who have been suspended for 6 months.

  1. Click the New Rule new rule button button.
  2. In the Select a trigger screen, select the Calendar event started trigger.
    The calendar event started trigger in xFanatical Foresight
  3. In the Edit trigger > Calendar event started action screen,
    1. In the Calendars field, select the Primary calendar variable from the dropdown.
    2. In the Event title field, enter the calendar event title keywords. This must match with part of Rule 1‘s calendar event title.
    3. Click Next.
  4. In the Select an action screen, select the Get calendar event info action.
    Get calendar event info action to retrieve event information from calendar in xFanatical Foresight
  5. In the Edit actions > Get calendar event info action screen,
    Configure get calendar event info action for auto delete users suspended for 6 months rule.
    1. In the Calendar field, select the Calendar id variable from the Calendar event started trigger.
    2. In the Event field, select the Calendar event id variable from the Calendar event started trigger.
    3. Click Add next action.
  6. In the Select an action screen, select the Extract data from text action.
    Select extract data from text action for auto delete users suspended for 6 months rule.
  7. In the Edit actions > Extract data from text action screen,
    Configure extract data from text action for auto delete users suspended for 6 months rule.
    1. In the Source text field, select the Event title variable from the Get calendar event info trigger.
    2. In the Data type to extract field, select the EMAIL variable from the dropdown.
    3. In the Variable name field, enter a descriptive name for the variable.
    4. Click Add next action.
  8. In the Select an action screen, select the Delete user action.
    On the Select an action screen, click the Delete user action
  9. In the Edit actions > Delete user action screen,
    Configure delete user action for auto delete users suspended for 6 months rule.
  10. In the Review screen,
    In the Review page, provide rule name and create Auto delete users suspended for 6 months rule.
    1. In Rule name, enter a rule name.
    2. Click Create.
  11. The automation rule is created.
    rule graph for automating the deletion of users who have been suspended for 6 months in Google Workspace.
    xFanatical Foresight rule graph for automating the deletion of users who have been suspended for 6 months in Google Workspace.
Verify Automation

Verify Automation

To ensure that your rule setup automates as expected, it’s essential to conduct a simple test. The following instructions demonstrate how xFanatical Foresight automates the deletion of Google Workspace users suspended for 6 months, ensuring streamlined account management and compliance.

Note: For demonstration purposes, set the Time Change Steps field in the Convert datetime action of Rule 1 to 15 minutes instead of 6 months to see the automation in action sooner.

  1. Sign in to your Google Admin Console.
  2. Suspend the user to trigger Rule 1 in xFanatical Foresight. Learn more about suspending a user in Google Admin.
    User is been suspended for demonstration purpose.
  3. Go to the Rules page.
  4. Wait for the notification in the top-right corner indicating that Rule 1 has been executed. In the notification message, click View log.
    A notification for user deletion calendar event creation.
  5. In the Logs > Log details page, the Rule history section explains the automation history and confirms the results of Rule 1.
    Logs detailed page for user deletion calendar event creation.
  6. Go to your Google Calendar, and verify that the calendar event was successfully created as a result of Rule 1.
    Calendar event created by the execution of Rule 1.
  7. Wait until the calendar event’s time.
  8. Once the scheduled calendar event begins, Rule 2 will automatically trigger.
  9. Wait for the notification in the top-right corner confirming the execution of Rule 2. In the notification message, click View log.
    A notification will be triggered and sent upon the execution of the rule, informing users of the action taken.
  10. In the Logs > Log details page, the Rule history section explains the automation history and confirms the results of Rule 2.
    A detailed log screen, sent upon the execution of the rule, informing users of the action taken.
  11. Verify that the suspended user has been successfully deleted in the Google Admin Console.
    Verification screen in Google Admin Console for user deletion.

Notes

  • Once the automation rule is established, xFanatical Foresight will begin monitoring for newly suspended users. Only users who are newly suspended will trigger Rule 1, and their accounts will be automatically deleted based on the configured schedule.
  • Before suspending a user, ensure that any critical data associated with the user accounts has been backed up or transferred. 
  • Once deleted, user data is retained in the Recently deleted users section for 20 days, during which recovery is possible. Learn more about restoring users from Google’s support.
  • At each time a rule is executed, you will receive a notification in the app telling you how it has happened to your rules and whether rules executed successfully or not.
  • The event title in Rule 2's trigger must match with a part of the Rule 1's calendar event title. Otherwise, Rule 2 cannot find the event and trigger the automation.
  • To cancel or reschedule the auto deletion for particular users, simply move the calendar events created by the Rule 1

Conclusion

In conclusion, automating the deletion of Google Workspace users who have been suspended for six months with xFanatical Foresight helps organizations maintain a clean and compliant user directory. By eliminating inactive accounts, admins can enhance security, reduce unnecessary license costs, and streamline user management. This automation ensures efficiency and consistency, allowing IT teams to focus on more critical tasks while keeping the workspace organized.

Try a 14-day free trial with xFanatical Foresight and manage your tasks.


Related Articles

For more article please visit our website: Articles