how to enable auto delete user after 90 days in google workspace
- User
how to enable auto delete user after 90 days in google workspace
Assistant
Enabling auto-delete for users after a specified inactivity period, such as 90 days, in Google Workspace (formerly G Suite) involves using the Google Admin Console in conjunction with Google Cloud's Identity and Access Management (IAM) features, specifically through the use of custom scripts utilizing the Admin SDK. As of my last update, here’s a step-by-step guide on how to approach this, noting that Google’s interface and features are subject to change:
Method 1: Using Custom Scripts with Admin SDK
Prerequisites:
- Google Cloud Project: Linked to your Google Workspace.
- Enable Admin SDK: In the Google Cloud Console.
- Service Account with Proper Permissions: For running scripts without user interaction.
- Scripting Knowledge: Basic understanding of scripting (e.g., Python, Apps Script).
Steps:
-
Enable Admin SDK:
- Go to the Google Cloud Console.
- Select or create a project linked to your Google Workspace.
- Navigate to
APIs & Services>Dashboard, click onEnable APIs and Services, search forAdmin SDK, and enable it.
-
Create a Service Account:
- In the Google Cloud Console, navigate to
IAM & Admin>Service accounts. - Create a new service account with the necessary permissions (at least
admin.directory.user.readandadmin.directory.user.deleteprivileges).
- In the Google Cloud Console, navigate to
-
Generate Keys for the Service Account:
- Create and download a private key in JSON format for your service account.
-
Write and Schedule a Script:
-
Using Google Apps Script:
- Open script.google.com.
- Use the
AdminSDKto write a script that checks for users inactive for 90 days by retrieving their last login time via thereports_v1.userUsageReportmethod and deletes them. - Schedule this script to run daily using Triggers.
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.